diff --git a/owl-bot-staging/google-cloud-asset/v1/.eslintignore b/owl-bot-staging/google-cloud-asset/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-asset/v1/.eslintrc.json b/owl-bot-staging/google-cloud-asset/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-asset/v1/.gitignore b/owl-bot-staging/google-cloud-asset/v1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-asset/v1/.jsdoc.js b/owl-bot-staging/google-cloud-asset/v1/.jsdoc.js new file mode 100644 index 00000000000..67e8627c41b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/asset', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-asset/v1/.mocharc.js b/owl-bot-staging/google-cloud-asset/v1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-asset/v1/.prettierrc.js b/owl-bot-staging/google-cloud-asset/v1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-asset/v1/README.md b/owl-bot-staging/google-cloud-asset/v1/README.md new file mode 100644 index 00000000000..b35f3a5e22b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/README.md @@ -0,0 +1 @@ +Asset: Nodejs Client diff --git a/owl-bot-staging/google-cloud-asset/v1/package.json b/owl-bot-staging/google-cloud-asset/v1/package.json new file mode 100644 index 00000000000..e478356ce8a --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/asset", + "version": "0.1.0", + "description": "Asset client for Node.js", + "repository": "googleapis/nodejs-asset", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google asset", + "asset", + "asset service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/asset/v1/asset_service.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/asset/v1/asset_service.proto new file mode 100644 index 00000000000..5ce750677e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/asset/v1/asset_service.proto @@ -0,0 +1,2793 @@ +// Copyright 2024 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.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/asset/v1/assets.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1"; +option go_package = "cloud.google.com/go/asset/apiv1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1"; +option php_namespace = "Google\\Cloud\\Asset\\V1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Exports assets with time and resource types to a given Cloud Storage + // location/BigQuery table. For Cloud Storage location destinations, the + // output format is newline-delimited JSON. Each line represents a + // [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON + // format; for BigQuery table destinations, the output table stores the fields + // in asset Protobuf as columns. This API implements the + // [google.longrunning.Operation][google.longrunning.Operation] API, which + // allows you to keep track of the export. We recommend intervals of at least + // 2 seconds with exponential retry to poll the export operation result. For + // regular-size resource parent, the export operation usually finishes within + // 5 minutes. + rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=*/*}:exportAssets" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1.ExportAssetsResponse" + metadata_type: "google.cloud.asset.v1.ExportAssetsRequest" + }; + } + + // Lists assets with time and resource types and returns paged results in + // response. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}/assets" + }; + option (google.api.method_signature) = "parent"; + } + + // Batch gets the update history of assets that overlap a time window. + // For IAM_POLICY content, this API outputs history when the asset and its + // attached IAM POLICY both exist. This can create gaps in the output history. + // Otherwise, this API outputs history with asset in both non-delete or + // deleted status. + // If a specified asset does not exist, this API returns an INVALID_ARGUMENT + // error. + rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) + returns (BatchGetAssetsHistoryResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}:batchGetAssetsHistory" + }; + } + + // Creates a feed in a parent project/folder/organization to listen to its + // asset updates. + rpc CreateFeed(CreateFeedRequest) returns (Feed) { + option (google.api.http) = { + post: "/v1/{parent=*/*}/feeds" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details about an asset feed. + rpc GetFeed(GetFeedRequest) returns (Feed) { + option (google.api.http) = { + get: "/v1/{name=*/*/feeds/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all asset feeds in a parent project/folder/organization. + rpc ListFeeds(ListFeedsRequest) returns (ListFeedsResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}/feeds" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an asset feed configuration. + rpc UpdateFeed(UpdateFeedRequest) returns (Feed) { + option (google.api.http) = { + patch: "/v1/{feed.name=*/*/feeds/*}" + body: "*" + }; + option (google.api.method_signature) = "feed"; + } + + // Deletes an asset feed. + rpc DeleteFeed(DeleteFeedRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=*/*/feeds/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Searches all Google Cloud resources within the specified scope, such as a + // project, folder, or organization. The caller must be granted the + // `cloudasset.assets.searchAllResources` permission on the desired scope, + // otherwise the request will be rejected. + rpc SearchAllResources(SearchAllResourcesRequest) + returns (SearchAllResourcesResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}:searchAllResources" + }; + option (google.api.method_signature) = "scope,query,asset_types"; + } + + // Searches all IAM policies within the specified scope, such as a project, + // folder, or organization. The caller must be granted the + // `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, + // otherwise the request will be rejected. + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) + returns (SearchAllIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}:searchAllIamPolicies" + }; + option (google.api.method_signature) = "scope,query"; + } + + // Analyzes IAM policies to answer which identities have what accesses on + // which resources. + rpc AnalyzeIamPolicy(AnalyzeIamPolicyRequest) + returns (AnalyzeIamPolicyResponse) { + option (google.api.http) = { + get: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" + }; + } + + // Analyzes IAM policies asynchronously to answer which identities have what + // accesses on which resources, and writes the analysis results to a Google + // Cloud Storage or a BigQuery destination. For Cloud Storage destination, the + // output format is the JSON format that represents a + // [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. + // This method implements the + // [google.longrunning.Operation][google.longrunning.Operation], which allows + // you to track the operation status. We recommend intervals of at least 2 + // seconds with exponential backoff retry to poll the operation result. The + // metadata contains the metadata for the long-running operation. + rpc AnalyzeIamPolicyLongrunning(AnalyzeIamPolicyLongrunningRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse" + metadata_type: "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata" + }; + } + + // Analyze moving a resource to a specified destination without kicking off + // the actual move. The analysis is best effort depending on the user's + // permissions of viewing different hierarchical policies and configurations. + // The policies and configuration are subject to change before the actual + // resource migration takes place. + rpc AnalyzeMove(AnalyzeMoveRequest) returns (AnalyzeMoveResponse) { + option (google.api.http) = { + get: "/v1/{resource=*/*}:analyzeMove" + }; + } + + // Issue a job that queries assets using a SQL statement compatible with + // [BigQuery SQL](https://cloud.google.com/bigquery/docs/introduction-sql). + // + // If the query execution finishes within timeout and there's no pagination, + // the full query results will be returned in the `QueryAssetsResponse`. + // + // Otherwise, full query results can be obtained by issuing extra requests + // with the `job_reference` from the a previous `QueryAssets` call. + // + // Note, the query result has approximately 10 GB limitation enforced by + // [BigQuery](https://cloud.google.com/bigquery/docs/best-practices-performance-output). + // Queries return larger results will result in errors. + rpc QueryAssets(QueryAssetsRequest) returns (QueryAssetsResponse) { + option (google.api.http) = { + post: "/v1/{parent=*/*}:queryAssets" + body: "*" + }; + } + + // Creates a saved query in a parent project/folder/organization. + rpc CreateSavedQuery(CreateSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + post: "/v1/{parent=*/*}/savedQueries" + body: "saved_query" + }; + option (google.api.method_signature) = "parent,saved_query,saved_query_id"; + } + + // Gets details about a saved query. + rpc GetSavedQuery(GetSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + get: "/v1/{name=*/*/savedQueries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all saved queries in a parent project/folder/organization. + rpc ListSavedQueries(ListSavedQueriesRequest) + returns (ListSavedQueriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=*/*}/savedQueries" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a saved query. + rpc UpdateSavedQuery(UpdateSavedQueryRequest) returns (SavedQuery) { + option (google.api.http) = { + patch: "/v1/{saved_query.name=*/*/savedQueries/*}" + body: "saved_query" + }; + option (google.api.method_signature) = "saved_query,update_mask"; + } + + // Deletes a saved query. + rpc DeleteSavedQuery(DeleteSavedQueryRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=*/*/savedQueries/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets effective IAM policies for a batch of resources. + rpc BatchGetEffectiveIamPolicies(BatchGetEffectiveIamPoliciesRequest) + returns (BatchGetEffectiveIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + }; + } + + // Analyzes organization policies under a scope. + rpc AnalyzeOrgPolicies(AnalyzeOrgPoliciesRequest) + returns (AnalyzeOrgPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}:analyzeOrgPolicies" + }; + option (google.api.method_signature) = "scope,constraint,filter"; + } + + // Analyzes organization policies governed containers (projects, folders or + // organization) under a scope. + rpc AnalyzeOrgPolicyGovernedContainers( + AnalyzeOrgPolicyGovernedContainersRequest) + returns (AnalyzeOrgPolicyGovernedContainersResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}:analyzeOrgPolicyGovernedContainers" + }; + option (google.api.method_signature) = "scope,constraint,filter"; + } + + // Analyzes organization policies governed assets (Google Cloud resources or + // policies) under a scope. This RPC supports custom constraints and the + // following canned constraints: + // + // * constraints/ainotebooks.accessMode + // * constraints/ainotebooks.disableFileDownloads + // * constraints/ainotebooks.disableRootAccess + // * constraints/ainotebooks.disableTerminal + // * constraints/ainotebooks.environmentOptions + // * constraints/ainotebooks.requireAutoUpgradeSchedule + // * constraints/ainotebooks.restrictVpcNetworks + // * constraints/compute.disableGuestAttributesAccess + // * constraints/compute.disableInstanceDataAccessApis + // * constraints/compute.disableNestedVirtualization + // * constraints/compute.disableSerialPortAccess + // * constraints/compute.disableSerialPortLogging + // * constraints/compute.disableVpcExternalIpv6 + // * constraints/compute.requireOsLogin + // * constraints/compute.requireShieldedVm + // * constraints/compute.restrictLoadBalancerCreationForTypes + // * constraints/compute.restrictProtocolForwardingCreationForTypes + // * constraints/compute.restrictXpnProjectLienRemoval + // * constraints/compute.setNewProjectDefaultToZonalDNSOnly + // * constraints/compute.skipDefaultNetworkCreation + // * constraints/compute.trustedImageProjects + // * constraints/compute.vmCanIpForward + // * constraints/compute.vmExternalIpAccess + // * constraints/gcp.detailedAuditLoggingMode + // * constraints/gcp.resourceLocations + // * constraints/iam.allowedPolicyMemberDomains + // * constraints/iam.automaticIamGrantsForDefaultServiceAccounts + // * constraints/iam.disableServiceAccountCreation + // * constraints/iam.disableServiceAccountKeyCreation + // * constraints/iam.disableServiceAccountKeyUpload + // * constraints/iam.restrictCrossProjectServiceAccountLienRemoval + // * constraints/iam.serviceAccountKeyExpiryHours + // * constraints/resourcemanager.accessBoundaries + // * constraints/resourcemanager.allowedExportDestinations + // * constraints/sql.restrictAuthorizedNetworks + // * constraints/sql.restrictNoncompliantDiagnosticDataAccess + // * constraints/sql.restrictNoncompliantResourceCreation + // * constraints/sql.restrictPublicIp + // * constraints/storage.publicAccessPrevention + // * constraints/storage.restrictAuthTypes + // * constraints/storage.uniformBucketLevelAccess + // + // This RPC only returns either resources of types [supported by search + // APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // or IAM policies. + rpc AnalyzeOrgPolicyGovernedAssets(AnalyzeOrgPolicyGovernedAssetsRequest) + returns (AnalyzeOrgPolicyGovernedAssetsResponse) { + option (google.api.http) = { + get: "/v1/{scope=*/*}:analyzeOrgPolicyGovernedAssets" + }; + option (google.api.method_signature) = "scope,constraint,filter"; + } +} + +// Represents the metadata of the longrunning operation for the +// AnalyzeIamPolicyLongrunning RPC. +message AnalyzeIamPolicyLongrunningMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Export asset request. +message ExportAssetsRequest { + // Required. The relative name of the root asset. This can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"), + // or a folder number (such as "folders/123"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between the current time and the current time minus 35 days (inclusive). + // If not specified, the current time will be used. Due to delays in resource + // data collection and indexing, there is a volatile window during which + // running the same query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types to take a snapshot for. For example: + // "compute.googleapis.com/Disk". + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + // + // If specified, only matching assets will be returned, otherwise, it will + // snapshot all asset types. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will be + // returned. + ContentType content_type = 4; + + // Required. Output configuration indicating where the results will be output + // to. + OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; + + // A list of relationship types to export, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it snapshots specified relationships. It returns an error if + // any of the [relationship_types] doesn't belong to the supported + // relationship types of the [asset_types] or if any of the [asset_types] + // doesn't belong to the source types of the [relationship_types]. + // * Otherwise: + // it snapshots the supported relationships for all [asset_types] or returns + // an error if any of the [asset_types] has no relationship support. + // An unspecified asset types field means all supported asset_types. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + // supported asset types and relationship types. + repeated string relationship_types = 6; +} + +// The export asset response. This message is returned by the +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] +// method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field. +message ExportAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Output configuration indicating where the results were output to. + OutputConfig output_config = 2; + + // Output result indicating where the assets were exported to. For example, a + // set of actual Cloud Storage object URIs where the assets are exported to. + // The URIs can be different from what [output_config] has specified, as the + // service will split the output object into multiple ones once it exceeds a + // single Cloud Storage object limit. + OutputResult output_result = 3; +} + +// ListAssets request. +message ListAssetsRequest { + // Required. Name of the organization, folder, or project the assets belong + // to. Format: "organizations/[organization-number]" (such as + // "organizations/123"), "projects/[project-id]" (such as + // "projects/my-project-id"), "projects/[project-number]" (such as + // "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between the current time and the current time minus 35 days (inclusive). + // If not specified, the current time will be used. Due to delays in resource + // data collection and indexing, there is a volatile window during which + // running the same query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types to take a snapshot for. For example: + // "compute.googleapis.com/Disk". + // + // Regular expression is also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + // + // If specified, only matching assets will be returned, otherwise, it will + // snapshot all asset types. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will + // be returned. + ContentType content_type = 4; + + // The maximum number of assets to be returned in a single response. Default + // is 100, minimum is 1, and maximum is 1000. + int32 page_size = 5; + + // The `next_page_token` returned from the previous `ListAssetsResponse`, or + // unspecified for the first `ListAssetsRequest`. It is a continuation of a + // prior `ListAssets` call, and the API should return the next page of assets. + string page_token = 6; + + // A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it snapshots specified relationships. It returns an error if + // any of the [relationship_types] doesn't belong to the supported + // relationship types of the [asset_types] or if any of the [asset_types] + // doesn't belong to the source types of the [relationship_types]. + // * Otherwise: + // it snapshots the supported relationships for all [asset_types] or returns + // an error if any of the [asset_types] has no relationship support. + // An unspecified asset types field means all supported asset_types. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types and relationship types. + repeated string relationship_types = 7; +} + +// ListAssets response. +message ListAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Assets. + repeated Asset assets = 2; + + // Token to retrieve the next page of results. It expires 72 hours after the + // page token for the first page is generated. Set to empty if there are no + // remaining results. + string next_page_token = 3; +} + +// Batch get assets history request. +message BatchGetAssetsHistoryRequest { + // Required. The relative name of the root asset. It can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id")", or a project number (such as "projects/12345"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; + + // A list of the full names of the assets. + // See: https://cloud.google.com/asset-inventory/docs/resource-name-format + // Example: + // + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // + // The request becomes a no-op if the asset name list is empty, and the max + // size of the asset name list is 100 in one request. + repeated string asset_names = 2; + + // Optional. The content type. + ContentType content_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The time window for the asset history. Both start_time and + // end_time are optional and if set, it must be after the current time minus + // 35 days. If end_time is not set, it is default to current timestamp. + // If start_time is not set, the snapshot of the assets at end_time will be + // returned. The returned results contain all temporal assets whose time + // window overlap with read_time_window. + TimeWindow read_time_window = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it outputs specified relationships' history on the [asset_names]. It + // returns an error if any of the [relationship_types] doesn't belong to the + // supported relationship types of the [asset_names] or if any of the + // [asset_names]'s types doesn't belong to the source types of the + // [relationship_types]. + // * Otherwise: + // it outputs the supported relationships' history on the [asset_names] or + // returns an error if any of the [asset_names]'s types has no relationship + // support. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + // supported asset types and relationship types. + repeated string relationship_types = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Batch get assets history response. +message BatchGetAssetsHistoryResponse { + // A list of assets with valid time windows. + repeated TemporalAsset assets = 1; +} + +// Create asset feed request. +message CreateFeedRequest { + // Required. The name of the project/folder/organization where this feed + // should be created in. It can only be an organization number (such as + // "organizations/123"), a folder number (such as "folders/123"), a project ID + // (such as "projects/my-project-id"), or a project number (such as + // "projects/12345"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. This is the client-assigned asset feed identifier and it needs to + // be unique under a specific parent project/folder/organization. + string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The feed details. The field `name` must be empty and it will be + // generated in the format of: projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Get asset feed request. +message GetFeedRequest { + // Required. The name of the Feed and it must be in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + ]; +} + +// List asset feeds request. +message ListFeedsRequest { + // Required. The parent project/folder/organization whose feeds are to be + // listed. It can only be using project/folder/organization number (such as + // "folders/12345")", or a project ID (such as "projects/my-project-id"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; +} + +message ListFeedsResponse { + // A list of feeds. + repeated Feed feeds = 1; +} + +// Update asset feed request. +message UpdateFeedRequest { + // Required. The new values of feed details. It must match an existing feed + // and the field `name` must be in the format of: + // projects/project_number/feeds/feed_id or + // folders/folder_number/feeds/feed_id or + // organizations/organization_number/feeds/feed_id. + Feed feed = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only updates the `feed` fields indicated by this mask. + // The field mask must not be empty, and it must not contain fields that + // are immutable or only set by the server. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +message DeleteFeedRequest { + // Required. The name of the feed and it must be in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + ]; +} + +// Output configuration for export assets destination. +message OutputConfig { + // Asset export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + + // Destination on BigQuery. The output table stores the fields in asset + // Protobuf as columns in BigQuery. + BigQueryDestination bigquery_destination = 2; + } +} + +// Output result of export assets. +message OutputResult { + // Asset export result. + oneof result { + // Export result on Cloud Storage. + GcsOutputResult gcs_result = 1; + } +} + +// A Cloud Storage output result. +message GcsOutputResult { + // List of URIs of the Cloud Storage objects. Example: + // "gs://bucket_name/object_name". + repeated string uris = 1; +} + +// A Cloud Storage location. +message GcsDestination { + // Required. + oneof object_uri { + // The URI of the Cloud Storage object. It's the same URI that is used by + // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + // + // If the specified Cloud Storage object already exists and there is no + // [hold](https://cloud.google.com/storage/docs/object-holds), it will be + // overwritten with the exported result. + string uri = 1; + + // The URI prefix of all generated Cloud Storage objects. Example: + // "gs://bucket_name/object_name_prefix". Each object URI is in format: + // "gs://bucket_name/object_name_prefix// and only + // contains assets for that type. starts from 0. Example: + // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + // the first shard of output objects containing all + // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + // returned if file with the same name "gs://bucket_name/object_name_prefix" + // already exists. + string uri_prefix = 2; + } +} + +// A BigQuery destination for exporting assets to. +message BigQueryDestination { + // Required. The BigQuery dataset in format + // "projects/projectId/datasets/datasetId", to which the snapshot result + // should be exported. If this dataset does not exist, the export call returns + // an INVALID_ARGUMENT error. Setting the `contentType` for `exportAssets` + // determines the + // [schema](/asset-inventory/docs/exporting-to-bigquery#bigquery-schema) + // of the BigQuery table. Setting `separateTablesPerAssetType` to `TRUE` also + // influences the schema. + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BigQuery table to which the snapshot result should be + // written. If this table does not exist, a new table with the given name + // will be created. + string table = 2 [(google.api.field_behavior) = REQUIRED]; + + // If the destination table already exists and this flag is `TRUE`, the + // table will be overwritten by the contents of assets snapshot. If the flag + // is `FALSE` or unset and the destination table already exists, the export + // call returns an INVALID_ARGUMEMT error. + bool force = 3; + + // [partition_spec] determines whether to export to partitioned table(s) and + // how to partition the data. + // + // If [partition_spec] is unset or [partition_spec.partition_key] is unset or + // `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to + // non-partitioned table(s). [force] will decide whether to overwrite existing + // table(s). + // + // If [partition_spec] is specified. First, the snapshot results will be + // written to partitioned table(s) with two additional timestamp columns, + // readTime and requestTime, one of which will be the partition key. Secondly, + // in the case when any destination table already exists, it will first try to + // update existing table's schema as necessary by appending additional + // columns. Then, if [force] is `TRUE`, the corresponding partition will be + // overwritten by the snapshot results (data in different partitions will + // remain intact); if [force] is unset or `FALSE`, it will append the data. An + // error will be returned if the schema update or data appension fails. + PartitionSpec partition_spec = 4; + + // If this flag is `TRUE`, the snapshot results will be written to one or + // multiple tables, each of which contains results of one asset type. The + // [force] and [partition_spec] fields will apply to each of them. + // + // Field [table] will be concatenated with "_" and the asset type names (see + // https://cloud.google.com/asset-inventory/docs/supported-asset-types for + // supported asset types) to construct per-asset-type table names, in which + // all non-alphanumeric characters like "." and "/" will be substituted by + // "_". Example: if field [table] is "mytable" and snapshot results + // contain "storage.googleapis.com/Bucket" assets, the corresponding table + // name will be "mytable_storage_googleapis_com_Bucket". If any of these + // tables does not exist, a new table with the concatenated name will be + // created. + // + // When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of + // each table will include RECORD-type columns mapped to the nested fields in + // the Asset.resource.data field of that asset type (up to the 15 nested level + // BigQuery supports + // (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The + // fields in >15 nested levels will be stored in JSON format string as a child + // column of its parent RECORD column. + // + // If error occurs when exporting to any table, the whole export call will + // return an error but the export results that already succeed will persist. + // Example: if exporting to table_type_A succeeds when exporting to + // table_type_B fails during one export call, the results in table_type_A will + // persist and there will not be partial results persisting in a table. + bool separate_tables_per_asset_type = 5; +} + +// Specifications of BigQuery partitioned table as export destination. +message PartitionSpec { + // This enum is used to determine the partition key column when exporting + // assets to BigQuery partitioned table(s). Note that, if the partition key is + // a timestamp column, the actual partition is based on its date value + // (expressed in UTC. see details in + // https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables). + enum PartitionKey { + // Unspecified partition key. If used, it means using non-partitioned table. + PARTITION_KEY_UNSPECIFIED = 0; + + // The time when the snapshot is taken. If specified as partition key, the + // result table(s) is partitoned by the additional timestamp column, + // readTime. If [read_time] in ExportAssetsRequest is specified, the + // readTime column's value will be the same as it. Otherwise, its value will + // be the current time that is used to take the snapshot. + READ_TIME = 1; + + // The time when the request is received and started to be processed. If + // specified as partition key, the result table(s) is partitoned by the + // requestTime column, an additional timestamp column representing when the + // request was received. + REQUEST_TIME = 2; + } + + // The partition key for BigQuery partitioned table. + PartitionKey partition_key = 1; +} + +// A Pub/Sub destination. +message PubsubDestination { + // The name of the Pub/Sub topic to publish to. + // Example: `projects/PROJECT_ID/topics/TOPIC_ID`. + string topic = 1; +} + +// Output configuration for asset feed destination. +message FeedOutputConfig { + // Asset feed destination. + oneof destination { + // Destination on Pub/Sub. + PubsubDestination pubsub_destination = 1; + } +} + +// An asset feed used to export asset updates to a destinations. +// An asset feed filter controls what updates are exported. +// The asset feed must be created within a project, organization, or +// folder. Supported destinations are: +// Pub/Sub topics. +message Feed { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Feed" + pattern: "projects/{project}/feeds/{feed}" + pattern: "folders/{folder}/feeds/{feed}" + pattern: "organizations/{organization}/feeds/{feed}" + history: ORIGINALLY_SINGLE_PATTERN + }; + + // Required. The format will be + // projects/{project_number}/feeds/{client-assigned_feed_identifier} or + // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + // organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + // + // The client-assigned feed identifier must be unique within the parent + // project/folder/organization. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of the full names of the assets to receive updates. You must specify + // either or both of asset_names and asset_types. Only asset updates matching + // specified asset_names or asset_types are exported to the feed. + // Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // For a list of the full names for supported asset types, see [Resource + // name format](/asset-inventory/docs/resource-name-format). + repeated string asset_names = 2; + + // A list of types of the assets to receive updates. You must specify either + // or both of asset_names and asset_types. Only asset updates matching + // specified asset_names or asset_types are exported to the feed. + // Example: `"compute.googleapis.com/Disk"` + // + // For a list of all supported asset types, see + // [Supported asset types](/asset-inventory/docs/supported-asset-types). + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name and + // type will be returned. + ContentType content_type = 4; + + // Required. Feed output configuration defining where the asset updates are + // published to. + FeedOutputConfig feed_output_config = 5 + [(google.api.field_behavior) = REQUIRED]; + + // A condition which determines whether an asset update should be published. + // If specified, an asset will be returned only when the expression evaluates + // to true. + // When set, `expression` field in the `Expr` must be a valid [CEL expression] + // (https://github.com/google/cel-spec) on a TemporalAsset with name + // `temporal_asset`. Example: a Feed with expression ("temporal_asset.deleted + // == true") will only publish Asset deletions. Other fields of `Expr` are + // optional. + // + // See our [user + // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) + // for detailed instructions. + google.type.Expr condition = 6; + + // A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it outputs specified relationship updates on the [asset_names] or the + // [asset_types]. It returns an error if any of the [relationship_types] + // doesn't belong to the supported relationship types of the [asset_names] or + // [asset_types], or any of the [asset_names] or the [asset_types] doesn't + // belong to the source types of the [relationship_types]. + // * Otherwise: + // it outputs the supported relationships of the types of [asset_names] and + // [asset_types] or returns an error if any of the [asset_names] or the + // [asset_types] has no replationship support. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types and relationship types. + repeated string relationship_types = 7; +} + +// Search all resources request. +message SearchAllResourcesRequest { + // Required. A scope can be a project, a folder, or an organization. The + // search is limited to the resources within the `scope`. The caller must be + // granted the + // [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + // permission on the desired scope. + // + // The allowed values are: + // + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. See [how to construct a + // query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + // for more information. If not specified or empty, it will search all the + // resources within the specified `scope`. + // + // Examples: + // + // * `name:Important` to find Google Cloud resources whose name contains + // `Important` as a word. + // * `name=Important` to find the Google Cloud resource whose name is exactly + // `Important`. + // * `displayName:Impor*` to find Google Cloud resources whose display name + // contains `Impor` as a prefix of any word in the field. + // * `location:us-west*` to find Google Cloud resources whose location + // contains both `us` and `west` as prefixes. + // * `labels:prod` to find Google Cloud resources whose labels contain `prod` + // as a key or value. + // * `labels.env:prod` to find Google Cloud resources that have a label `env` + // and its value is `prod`. + // * `labels.env:*` to find Google Cloud resources that have a label `env`. + // * `tagKeys:env` to find Google Cloud resources that have directly + // attached tags where the + // [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + // contains `env`. + // * `tagValues:prod*` to find Google Cloud resources that have directly + // attached tags where the + // [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + // contains a word prefixed by `prod`. + // * `tagValueIds=tagValues/123` to find Google Cloud resources that have + // directly attached tags where the + // [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + // is exactly `tagValues/123`. + // * `effectiveTagKeys:env` to find Google Cloud resources that have + // directly attached or inherited tags where the + // [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + // contains `env`. + // * `effectiveTagValues:prod*` to find Google Cloud resources that have + // directly attached or inherited tags where the + // [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + // contains a word prefixed by `prod`. + // * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + // have directly attached or inherited tags where the + // [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + // is exactly `tagValues/123`. + // * `kmsKey:key` to find Google Cloud resources encrypted with a + // customer-managed encryption key whose name contains `key` as a word. This + // field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + // key information. + // * `kmsKeys:key` to find Google Cloud resources encrypted with + // customer-managed encryption keys whose name contains the word `key`. + // * `relationships:instance-group-1` to find Google Cloud resources that have + // relationships with `instance-group-1` in the related resource name. + // * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + // instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + // * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + // Compute Engine instances that have relationships with `instance-group-1` + // in the Compute Engine instance group resource name, for relationship type + // `INSTANCE_TO_INSTANCEGROUP`. + // * `sccSecurityMarks.key=value` to find Cloud resources that are attached + // with security marks whose key is `key` and value is `value`. + // * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + // security marks whose key is `key`. + // * `state:ACTIVE` to find Google Cloud resources whose state contains + // `ACTIVE` as a word. + // * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + // contain `ACTIVE` as a word. + // * `createTime<1609459200` to find Google Cloud resources that were created + // before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + // `2021-01-01 00:00:00 UTC` in seconds. + // * `updateTime>1609459200` to find Google Cloud resources that were updated + // after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + // `2021-01-01 00:00:00 UTC` in seconds. + // * `Important` to find Google Cloud resources that contain `Important` as a + // word in any of the searchable fields. + // * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + // of any word in any of the searchable fields. + // * `Important location:(us-west1 OR global)` to find Google Cloud + // resources that contain `Important` as a word in any of the searchable + // fields and are also located in the `us-west1` region or the `global` + // location. + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that this request searches for. If empty, + // it will search all the asset types [supported by search + // APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Page size is capped + // at 500 even if a larger value is given. If set to zero or a negative value, + // server will pick an appropriate default. Returned results may be fewer than + // requested. When this happens, there could be more results as long as + // `next_page_token` is returned. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of all other + // method parameters, must be identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields specifying the sorting order of + // the results. The default order is ascending. Add " DESC" after the field + // name to indicate descending order. Redundant space characters are ignored. + // Example: "location DESC, name". + // Only the following fields in the response are sortable: + // + // * name + // * assetType + // * project + // * displayName + // * description + // * location + // * createTime + // * updateTime + // * state + // * parentFullResourceName + // * parentAssetType + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields that you want returned in the + // results. The following fields are returned by default if not specified: + // + // * `name` + // * `assetType` + // * `project` + // * `folders` + // * `organization` + // * `displayName` + // * `description` + // * `location` + // * `labels` + // * `tags` + // * `effectiveTags` + // * `networkTags` + // * `kmsKeys` + // * `createTime` + // * `updateTime` + // * `state` + // * `additionalAttributes` + // * `parentFullResourceName` + // * `parentAssetType` + // + // Some fields of large size, such as `versionedResources`, + // `attachedResources`, `effectiveTags` etc., are not returned by default, but + // you can specify them in the `read_mask` parameter if you want to include + // them. If `"*"` is specified, all [available + // fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + // are returned. + // Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + // Any invalid field path will trigger INVALID_ARGUMENT error. + google.protobuf.FieldMask read_mask = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all resources response. +message SearchAllResourcesResponse { + // A list of Resources that match the search query. It contains the resource + // standard metadata information. + repeated ResourceSearchResult results = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Search all IAM policies request. +message SearchAllIamPoliciesRequest { + // Required. A scope can be a project, a folder, or an organization. The + // search is limited to the IAM policies within the `scope`. The caller must + // be granted the + // [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + // permission on the desired scope. + // + // The allowed values are: + // + // * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + // * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + // * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. See [how to construct a + // query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + // for more information. If not specified or empty, it will search all the + // IAM policies within the specified `scope`. Note that the query string is + // compared against each IAM policy binding, including its principals, + // roles, and IAM conditions. The returned IAM policies will only + // contain the bindings that match your query. To learn more about the IAM + // policy structure, see the [IAM policy + // documentation](https://cloud.google.com/iam/help/allow-policies/structure). + // + // Examples: + // + // * `policy:amy@gmail.com` to find IAM policy bindings that specify user + // "amy@gmail.com". + // * `policy:roles/compute.admin` to find IAM policy bindings that specify + // the Compute Admin role. + // * `policy:comp*` to find IAM policy bindings that contain "comp" as a + // prefix of any word in the binding. + // * `policy.role.permissions:storage.buckets.update` to find IAM policy + // bindings that specify a role containing "storage.buckets.update" + // permission. Note that if callers don't have `iam.roles.get` access to a + // role's included permissions, policy bindings that specify this role will + // be dropped from the search results. + // * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + // role containing "upd" as a prefix of any word in the role permission. + // Note that if callers don't have `iam.roles.get` access to a role's + // included permissions, policy bindings that specify this role will be + // dropped from the search results. + // * `resource:organizations/123456` to find IAM policy bindings + // that are set on "organizations/123456". + // * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + // find IAM policy bindings that are set on the project named "myproject". + // * `Important` to find IAM policy bindings that contain "Important" as a + // word in any of the searchable fields (except for the included + // permissions). + // * `resource:(instance1 OR instance2) policy:amy` to find + // IAM policy bindings that are set on resources "instance1" or + // "instance2" and also specify user "amy". + // * `roles:roles/compute.admin` to find IAM policy bindings that specify the + // Compute Admin role. + // * `memberTypes:user` to find IAM policy bindings that contain the + // principal type "user". + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Page size is capped + // at 500 even if a larger value is given. If set to zero or a negative value, + // server will pick an appropriate default. Returned results may be fewer than + // requested. When this happens, there could be more results as long as + // `next_page_token` is returned. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieve the next batch of results from the preceding + // call to this method. `page_token` must be the value of `next_page_token` + // from the previous response. The values of all other method parameters must + // be identical to those in the previous call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that the IAM policies are attached to. If + // empty, it will search the IAM policies that are attached to all the asset + // types [supported by search + // APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + // starts with "compute.googleapis.com". + // * ".*Instance" snapshots IAM policies attached to asset type ends with + // "Instance". + // * ".*Instance.*" snapshots IAM policies attached to asset type contains + // "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + repeated string asset_types = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields specifying the sorting order of + // the results. The default order is ascending. Add " DESC" after the field + // name to indicate descending order. Redundant space characters are ignored. + // Example: "assetType DESC, resource". + // Only singular primitive fields in the response are sortable: + // * resource + // * assetType + // * project + // All the other fields such as repeated fields (e.g., `folders`) and + // non-primitive fields (e.g., `policy`) are not supported. + string order_by = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all IAM policies response. +message SearchAllIamPoliciesResponse { + // A list of IAM policies that match the search query. Related information + // such as the associated resource is returned along with the policy. + repeated IamPolicySearchResult results = 1; + + // Set if there are more results than those appearing in this response; to get + // the next set of results, call this method again, using this value as the + // `page_token`. + string next_page_token = 2; +} + +// 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. + message ResourceSelector { + // Required. The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of a resource of [supported resource + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#analyzable_asset_types). + 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 principals in + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). + // + // The examples of supported forms are: + // "user:mike@example.com", + // "group:admins@example.com", + // "domain:google.com", + // "serviceAccount:my-project-id@appspot.gserviceaccount.com". + // + // Notice that wildcard characters (such as * and ?) are not supported. + // You must give a specific identity. + 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 roles or permissions matching + // any of them. The total number of roles and permissions should be equal or + // less than 10. + 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]; + } + + // Contains query options. + message Options { + // Optional. If true, the identities section of the result will expand any + // Google groups appearing in an IAM policy binding. + // + // If + // [IamPolicyAnalysisQuery.identity_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.identity_selector] + // is specified, the identity in the result will be determined by the + // selector, and this flag is not allowed to set. + // + // If true, the default max expansion per group is 1000 for + // AssetService.AnalyzeIamPolicy][]. + // + // 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 + // [IamPolicyAnalysisQuery.access_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.access_selector] + // is specified, the access section of the result will be determined by the + // selector, and this flag is not allowed to set. + // + // Default is false. + bool expand_roles = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true and + // [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + // is not specified, the resource section of the result will expand any + // resource attached to an IAM policy to include resources lower in the + // resource hierarchy. + // + // 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 Google + // Cloud folder, the results will also include resources in that folder with + // permission P. + // + // If true and + // [IamPolicyAnalysisQuery.resource_selector][google.cloud.asset.v1.IamPolicyAnalysisQuery.resource_selector] + // is specified, the resource section of the result will expand the + // specified resource to include resources lower in the resource hierarchy. + // Only project or lower resources are supported. Folder and organization + // resources cannot be used together with this option. + // + // For example, if the request analyzes for which users have permission P on + // a Google Cloud project with this option enabled, the results will include + // all users who have permission P on that project or any lower resource. + // + // If true, the default max expansion per resource is 1000 for + // AssetService.AnalyzeIamPolicy][] and 100000 for + // AssetService.AnalyzeIamPolicyLongrunning][]. + // + // Default is false. + bool expand_resources = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the result will output the relevant parent/child + // relationships between resources. Default is false. + bool output_resource_edges = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the result will output the relevant membership + // relationships between groups and other groups, and between groups and + // principals. Default is false. + bool output_group_edges = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the response will include access analysis from + // identities to resources via service account impersonation. This is a very + // expensive operation, because many derived queries will be executed. We + // highly recommend you use + // [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + // RPC instead. + // + // 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 Google Cloud folder F, then user A potentially has access to the + // Google Cloud folder F. And those advanced analysis results will be + // included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Another example, if the request analyzes for who has + // permission P to a Google Cloud 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 Google Cloud folder F, then user A potentially has access to the + // Google Cloud folder F. And those advanced analysis results will be + // included in + // [AnalyzeIamPolicyResponse.service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis]. + // + // Only the following permissions are considered in this analysis: + // + // * `iam.serviceAccounts.actAs` + // * `iam.serviceAccounts.signBlob` + // * `iam.serviceAccounts.signJwt` + // * `iam.serviceAccounts.getAccessToken` + // * `iam.serviceAccounts.getOpenIdToken` + // * `iam.serviceAccounts.implicitDelegation` + // + // Default is false. + bool analyze_service_account_impersonation = 6 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The IAM conditions context. + message ConditionContext { + // The IAM conditions time context. + oneof TimeContext { + // The hypothetical access timestamp to evaluate IAM conditions. Note that + // this value must not be earlier than the current time; otherwise, an + // INVALID_ARGUMENT error will be returned. + google.protobuf.Timestamp access_time = 1; + } + } + + // Required. The relative name of the root asset. Only resources and IAM + // policies within the scope will be analyzed. + // + // This can only be an organization number (such as "organizations/123"), a + // folder number (such as "folders/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"). + // + // To know how to get organization ID, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + // + // To know how to get folder or project ID, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies a resource for analysis. + ResourceSelector resource_selector = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies an identity for analysis. + IdentitySelector identity_selector = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies roles or permissions for analysis. This is optional. + AccessSelector access_selector = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The query options. + Options options = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The hypothetical context for IAM conditions evaluation. + ConditionContext condition_context = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for +// [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyRequest { + // Required. The request query. + IamPolicyAnalysisQuery analysis_query = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The name of a saved query, which must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + // + // If both `analysis_query` and `saved_analysis_query` are provided, they + // will be merged together with the `saved_analysis_query` as base and + // the `analysis_query` as overrides. For more details of the merge behavior, + // refer to the + // [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + // page. + // + // Note that you cannot override primitive fields with default value, such as + // 0 or empty string, etc., because we use proto3, which doesn't support field + // presence yet. + string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Amount of time executable has to complete. See JSON + // representation of + // [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 = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for +// [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy]. +message AnalyzeIamPolicyResponse { + // An analysis message to group the query and results. + message IamPolicyAnalysis { + // The analysis query. + IamPolicyAnalysisQuery analysis_query = 1; + + // A list of + // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult] + // that matches the analysis query, or empty if no result is found. + repeated IamPolicyAnalysisResult analysis_results = 2; + + // Represents whether all entries in the + // [analysis_results][google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysis_results] + // have been fully explored to answer the query. + bool fully_explored = 3; + + // A list of non-critical errors happened during the query handling. + repeated IamPolicyAnalysisState non_critical_errors = 5; + } + + // 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.v1.AnalyzeIamPolicyResponse.main_analysis] + // and + // [service_account_impersonation_analysis][google.cloud.asset.v1.AnalyzeIamPolicyResponse.service_account_impersonation_analysis] + // have been fully explored to answer the query in the request. + bool fully_explored = 3; +} + +// 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. Example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + // + // If the specified Cloud Storage object already exists and there is no + // [hold](https://cloud.google.com/storage/docs/object-holds), it will be + // overwritten with the analysis result. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A BigQuery destination. + message BigQueryDestination { + // This enum determines the partition key column for the bigquery tables. + // Partitioning can improve query performance and reduce query cost by + // filtering partitions. Refer to + // https://cloud.google.com/bigquery/docs/partitioned-tables for details. + enum PartitionKey { + // Unspecified partition key. Tables won't be partitioned using this + // option. + PARTITION_KEY_UNSPECIFIED = 0; + + // The time when the request is received. If specified as partition key, + // the result table(s) is partitoned by the RequestTime column, an + // additional timestamp column representing when the request was received. + REQUEST_TIME = 1; + } + + // Required. The BigQuery dataset in format + // "projects/projectId/datasets/datasetId", to which the analysis results + // should be exported. If this dataset does not exist, the export call will + // return an INVALID_ARGUMENT error. + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The prefix of the BigQuery tables to which the analysis results + // will be written. Tables will be created based on this table_prefix if not + // exist: + // * _analysis table will contain export operation's metadata. + // * _analysis_result will contain all the + // [IamPolicyAnalysisResult][google.cloud.asset.v1.IamPolicyAnalysisResult]. + // When [partition_key] is specified, both tables will be partitioned based + // on the [partition_key]. + string table_prefix = 2 [(google.api.field_behavior) = REQUIRED]; + + // The partition key for BigQuery partitioned table. + PartitionKey partition_key = 3; + + // Optional. Specifies the action that occurs if the destination table or + // partition already exists. The following values are supported: + // + // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + // overwrites the entire table or all the partitions data. + // * WRITE_APPEND: If the table or partition already exists, BigQuery + // appends the data to the table or the latest partition. + // * WRITE_EMPTY: If the table already exists and contains data, an error is + // returned. + // + // The default value is WRITE_APPEND. Each action is atomic and only occurs + // if BigQuery is able to complete the job successfully. Details are at + // https://cloud.google.com/bigquery/docs/loading-data-local#appending_to_or_overwriting_a_table_using_a_local_file. + string write_disposition = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // IAM policy analysis export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + + // Destination on BigQuery. + BigQueryDestination bigquery_destination = 2; + } +} + +// A request message for +// [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +message AnalyzeIamPolicyLongrunningRequest { + // Required. The request query. + IamPolicyAnalysisQuery analysis_query = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The name of a saved query, which must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + // + // If both `analysis_query` and `saved_analysis_query` are provided, they + // will be merged together with the `saved_analysis_query` as base and + // the `analysis_query` as overrides. For more details of the merge behavior, + // refer to the + // [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + // doc. + // + // Note that you cannot override primitive fields with default value, such as + // 0 or empty string, etc., because we use proto3, which doesn't support field + // presence yet. + string saved_analysis_query = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Output configuration indicating where the results will be output + // to. + IamPolicyAnalysisOutputConfig output_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// A response message for +// [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning]. +message AnalyzeIamPolicyLongrunningResponse {} + +// A saved query which can be shared with others or used later. +message SavedQuery { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/SavedQuery" + pattern: "projects/{project}/savedQueries/{saved_query}" + pattern: "folders/{folder}/savedQueries/{saved_query}" + pattern: "organizations/{organization}/savedQueries/{saved_query}" + }; + + // The query content. + message QueryContent { + oneof query_content { + // An IAM Policy Analysis query, which could be used in + // the + // [AssetService.AnalyzeIamPolicy][google.cloud.asset.v1.AssetService.AnalyzeIamPolicy] + // RPC or the + // [AssetService.AnalyzeIamPolicyLongrunning][google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning] + // RPC. + IamPolicyAnalysisQuery iam_policy_analysis_query = 1; + } + } + + // The resource name of the saved query. The format must be: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1; + + // The description of this saved query. This value should be fewer than 255 + // characters. + string description = 2; + + // Output only. The create time of this saved query. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The account's email address who has created this saved query. + string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last update time of this saved query. + google.protobuf.Timestamp last_update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The account's email address who has updated this saved query + // most recently. + string last_updater = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels applied on the resource. + // This value should not contain more than 10 entries. The key and value of + // each entry must be non-empty and fewer than 64 characters. + map labels = 7; + + // The query content. + QueryContent content = 8; +} + +// Request to create a saved query. +message CreateSavedQueryRequest { + // Required. The name of the project/folder/organization where this + // saved_query should be created in. It can only be an organization number + // (such as "organizations/123"), a folder number (such as "folders/123"), a + // project ID (such as "projects/my-project-id"), or a project number (such as + // "projects/12345"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/SavedQuery" + } + ]; + + // Required. The saved_query details. The `name` field must be empty as it + // will be generated based on the parent and saved_query_id. + SavedQuery saved_query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the saved query, which must be unique in the + // specified parent. It will become the final component of the saved query's + // resource name. + // + // This value should be 4-63 characters, and valid characters + // are `[a-z][0-9]-`. + // + // Notice that this field is required in the saved query creation, and the + // `name` field of the `saved_query` will be ignored. + string saved_query_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to get a saved query. +message GetSavedQueryRequest { + // Required. The name of the saved query and it must be in the format of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/SavedQuery" + } + ]; +} + +// Request to list saved queries. +message ListSavedQueriesRequest { + // Required. The parent project/folder/organization whose savedQueries are to + // be listed. It can only be using project/folder/organization number (such as + // "folders/12345")", or a project ID (such as "projects/my-project-id"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/SavedQuery" + } + ]; + + // Optional. The expression to filter resources. + // The expression is a list of zero or more restrictions combined via logical + // operators `AND` and `OR`. When `AND` and `OR` are both used in the + // expression, parentheses must be appropriately used to group the + // combinations. The expression may also contain regular expressions. + // + // See https://google.aip.dev/160 for more information on the grammar. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of saved queries to return per page. The + // service may return fewer than this value. If unspecified, at most 50 will + // be returned. The maximum value is 1000; values above 1000 will be coerced + // to 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListSavedQueries` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListSavedQueries` must + // match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of listing saved queries. +message ListSavedQueriesResponse { + // A list of savedQueries. + repeated SavedQuery saved_queries = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Request to update a saved query. +message UpdateSavedQueryRequest { + // Required. The saved query to update. + // + // The saved query's `name` field is used to identify the one to update, + // which has format as below: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + SavedQuery saved_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete a saved query. +message DeleteSavedQueryRequest { + // Required. The name of the saved query to delete. It must be in the format + // of: + // + // * projects/project_number/savedQueries/saved_query_id + // * folders/folder_number/savedQueries/saved_query_id + // * organizations/organization_number/savedQueries/saved_query_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudasset.googleapis.com/SavedQuery" + } + ]; +} + +// The request message for performing resource move analysis. +message AnalyzeMoveRequest { + // View enum for supporting partial analysis responses. + enum AnalysisView { + // The default/unset value. + // The API will default to the FULL view. + ANALYSIS_VIEW_UNSPECIFIED = 0; + + // Full analysis including all level of impacts of the specified resource + // move. + FULL = 1; + + // Basic analysis only including blockers which will prevent the specified + // resource move at runtime. + BASIC = 2; + } + + // Required. Name of the resource to perform the analysis against. + // Only Google Cloud projects are supported as of today. Hence, this can only + // be a project ID (such as "projects/my-project-id") or a project number + // (such as "projects/12345"). + string resource = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Name of the Google Cloud folder or organization to reparent the + // target resource. The analysis will be performed against hypothetically + // moving the resource to this specified desitination parent. This can only be + // a folder number (such as "folders/123") or an organization number (such as + // "organizations/123"). + string destination_parent = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // Analysis view indicating what information should be included in the + // analysis response. If unspecified, the default view is FULL. + AnalysisView view = 3; +} + +// The response message for resource move analysis. +message AnalyzeMoveResponse { + // The list of analyses returned from performing the intended resource move + // analysis. The analysis is grouped by different Google Cloud services. + repeated MoveAnalysis move_analysis = 1; +} + +// A message to group the analysis information. +message MoveAnalysis { + // The user friendly display name of the analysis. E.g. IAM, organization + // policy etc. + string display_name = 1; + + oneof result { + // Analysis result of moving the target resource. + MoveAnalysisResult analysis = 2; + + // Description of error encountered when performing the analysis. + google.rpc.Status error = 3; + } +} + +// An analysis result including blockers and warnings. +message MoveAnalysisResult { + // Blocking information that would prevent the target resource from moving + // to the specified destination at runtime. + repeated MoveImpact blockers = 1; + + // Warning information indicating that moving the target resource to the + // specified destination might be unsafe. This can include important policy + // information and configuration changes, but will not block moves at runtime. + repeated MoveImpact warnings = 2; +} + +// A message to group impacts of moving the target resource. +message MoveImpact { + // User friendly impact detail in a free form message. + string detail = 1; +} + +// Output configuration query assets. +message QueryAssetsOutputConfig { + // BigQuery destination. + message BigQueryDestination { + // Required. The BigQuery dataset where the query results will be saved. It + // has the format of "projects/{projectId}/datasets/{datasetId}". + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BigQuery table where the query results will be saved. If + // this table does not exist, a new table with the given name will be + // created. + string table = 2 [(google.api.field_behavior) = REQUIRED]; + + // Specifies the action that occurs if the destination table or partition + // already exists. The following values are supported: + // + // * WRITE_TRUNCATE: If the table or partition already exists, BigQuery + // overwrites the entire table or all the partitions data. + // * WRITE_APPEND: If the table or partition already exists, BigQuery + // appends the data to the table or the latest partition. + // * WRITE_EMPTY: If the table already exists and contains data, a + // 'duplicate' error is returned in the job result. + // + // The default value is WRITE_EMPTY. + string write_disposition = 3; + } + + // BigQuery destination where the query results will be saved. + BigQueryDestination bigquery_destination = 1; +} + +// QueryAssets request. +message QueryAssetsRequest { + // Required. The relative name of the root asset. This can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"), + // or a folder number (such as "folders/123"). + // + // Only assets belonging to the `parent` will be returned. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; + + oneof query { + // Optional. A SQL statement that's compatible with [BigQuery + // SQL](https://cloud.google.com/bigquery/docs/introduction-sql). + string statement = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reference to the query job, which is from the + // `QueryAssetsResponse` of previous `QueryAssets` call. + string job_reference = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The maximum number of rows to return in the results. Responses + // are limited to 10 MB and 1000 rows. + // + // By default, the maximum row count is 1000. When the byte or row count limit + // is reached, the rest of the query results will be paginated. + // + // The field will be ignored when [output_config] is specified. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token received from previous `QueryAssets`. + // + // The field will be ignored when [output_config] is specified. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the maximum amount of time that the client is willing + // to wait for the query to complete. By default, this limit is 5 min for the + // first query, and 1 minute for the following queries. If the query is + // complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + // false. + // + // Like BigQuery [jobs.query + // API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + // The call is not guaranteed to wait for the specified timeout; it typically + // returns after around 200 seconds (200,000 milliseconds), even if the query + // is not complete. + // + // The field will be ignored when [output_config] is specified. + google.protobuf.Duration timeout = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Specifies what time period or point in time to query asset metadata at. + // * unset - query asset metadata as it is right now + // * [read_time_window] - query asset metadata as it was at any point in time + // between [start_time] and [end_time]. + // * [read_time] - query asset metadata as it was at that point in time. + // If data for the timestamp/date range selected does not exist, + // it will simply return a valid response with no rows. + oneof time { + // Optional. [start_time] is required. [start_time] must be less than + // [end_time] Defaults [end_time] to now if [start_time] is set and + // [end_time] isn't. Maximum permitted time range is 7 days. + TimeWindow read_time_window = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Queries cloud assets as they appeared at the specified point in + // time. + google.protobuf.Timestamp read_time = 8 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. Destination where the query results will be saved. + // + // When this field is specified, the query results won't be saved in the + // [QueryAssetsResponse.query_result]. Instead + // [QueryAssetsResponse.output_config] will be set. + // + // Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used + // to check the status of the query job when passed to a following + // [QueryAssets] API call. + QueryAssetsOutputConfig output_config = 9 + [(google.api.field_behavior) = OPTIONAL]; +} + +// QueryAssets response. +message QueryAssetsResponse { + // Reference to a query job. + string job_reference = 1; + + // The query response, which can be either an `error` or a valid `response`. + // + // If `done` == `false` and the query result is being saved in an output, the + // output_config field will be set. + // If `done` == `true`, exactly one of + // `error`, `query_result` or `output_config` will be set. + // [done] is unset unless the [QueryAssetsResponse] contains a + // [QueryAssetsResponse.job_reference]. + bool done = 2; + + oneof response { + // Error status. + google.rpc.Status error = 3; + + // Result of the query. + QueryResult query_result = 4; + + // Output configuration, which indicates that instead of being returned in + // an API response on the fly, the query result will be saved in a specific + // output. + QueryAssetsOutputConfig output_config = 5; + } +} + +// Execution results of the query. +// +// The result is formatted as rows represented by BigQuery compatible [schema]. +// When pagination is necessary, it will contains the page token to retrieve +// the results of following pages. +message QueryResult { + // Each row hold a query result in the format of `Struct`. + repeated google.protobuf.Struct rows = 1; + + // Describes the format of the [rows]. + TableSchema schema = 2; + + // Token to retrieve the next page of the results. + string next_page_token = 3; + + // Total rows of the whole query results. + int64 total_rows = 4; +} + +// BigQuery Compatible table schema. +message TableSchema { + // Describes the fields in a table. + repeated TableFieldSchema fields = 1; +} + +// A field in TableSchema. +message TableFieldSchema { + // The field name. The name must contain only letters (a-z, A-Z), + // numbers (0-9), or underscores (_), and must start with a letter or + // underscore. The maximum length is 128 characters. + string field = 1; + + // The field data type. Possible values include + // * STRING + // * BYTES + // * INTEGER + // * FLOAT + // * BOOLEAN + // * TIMESTAMP + // * DATE + // * TIME + // * DATETIME + // * GEOGRAPHY, + // * NUMERIC, + // * BIGNUMERIC, + // * RECORD + // (where RECORD indicates that the field contains a nested schema). + string type = 2; + + // The field mode. Possible values include NULLABLE, REQUIRED and + // REPEATED. The default value is NULLABLE. + string mode = 3; + + // Describes the nested schema fields if the type property is set + // to RECORD. + repeated TableFieldSchema fields = 4; +} + +// A request message for +// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. +message BatchGetEffectiveIamPoliciesRequest { + // Required. Only IAM policies on or below the scope will be returned. + // + // This can only be an organization number (such as "organizations/123"), a + // folder number (such as "folders/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"). + // + // To know how to get organization ID, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + // + // To know how to get folder or project ID, visit [here + // ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + string scope = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { child_type: "*" } + ]; + + // Required. The names refer to the [full_resource_names] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of the asset types [supported by search + // APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + // A maximum of 20 resources' effective policies can be retrieved in a batch. + repeated string names = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; +} + +// A response message for +// [AssetService.BatchGetEffectiveIamPolicies][google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies]. +message BatchGetEffectiveIamPoliciesResponse { + // The effective IAM policies on one resource. + message EffectiveIamPolicy { + // The IAM policy and its attached resource. + message PolicyInfo { + // The full resource name the + // [policy][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy] + // is directly attached to. + string attached_resource = 1; + + // The IAM policy that's directly attached to the + // [attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource]. + google.iam.v1.Policy policy = 2; + } + + // The [full_resource_name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) + // for which the + // [policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies] + // are computed. This is one of the + // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names] + // the caller provides in the request. + string full_resource_name = 1; + + // The effective policies for the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + // + // These policies include the policy set on the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + // and those set on its parents and ancestors up to the + // [BatchGetEffectiveIamPoliciesRequest.scope][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.scope]. + // Note that these policies are not filtered according to the resource type + // of the + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name]. + // + // These policies are hierarchically ordered by + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + // starting from + // [full_resource_name][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.full_resource_name] + // itself to its parents and ancestors, such that policies[i]'s + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource] + // is the child of policies[i+1]'s + // [PolicyInfo.attached_resource][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.attached_resource], + // if policies[i+1] exists. + repeated PolicyInfo policies = 2; + } + + // The effective policies for a batch of resources. Note that the results + // order is the same as the order of + // [BatchGetEffectiveIamPoliciesRequest.names][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names]. + // When a resource does not have any effective IAM policies, its corresponding + // policy_result will contain empty + // [EffectiveIamPolicy.policies][google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies]. + repeated EffectiveIamPolicy policy_results = 2; +} + +// This organization policy message is a modified version of the one defined in +// the Organization Policy system. This message contains several fields defined +// in the original organization policy with some new fields for analysis +// purpose. +message AnalyzerOrgPolicy { + // This rule message is a customized version of the one defined in the + // Organization Policy system. In addition to the fields defined in the + // original organization policy, it contains additional field(s) under + // specific circumstances to support analysis results. + message Rule { + // The string values for the list constraints. + message StringValues { + // List of values allowed at this resource. + repeated string allowed_values = 1; + + // List of values denied at this resource. + repeated string denied_values = 2; + } + + oneof kind { + // List of values to be used for this policy rule. This field can be set + // only in policies for list constraints. + StringValues values = 3; + + // Setting this to true means that all values are allowed. This field can + // be set only in Policies for list constraints. + bool allow_all = 4; + + // Setting this to true means that all values are denied. This field can + // be set only in Policies for list constraints. + bool deny_all = 5; + + // If `true`, then the `Policy` is enforced. If `false`, then any + // configuration is acceptable. + // This field can be set only in Policies for boolean constraints. + bool enforce = 6; + } + + // The evaluating condition for this rule. + google.type.Expr condition = 7; + + // The condition evaluation result for this rule. + // Only populated if it meets all the following criteria: + // + // * There is a + // [condition][google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.condition] + // defined for this rule. + // * This rule is within + // [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidated_policy], + // or + // [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidated_policy] + // when the + // [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset] + // has + // [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governed_resource]. + ConditionEvaluation condition_evaluation = 8; + } + + // The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + // an organization/folder/project resource where this organization policy is + // set. + // + // Notice that some type of constraints are defined with default policy. This + // field will be empty for them. + string attached_resource = 1; + + // The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + // an organization/folder/project resource where this organization policy + // applies to. + // + // For any user defined org policies, this field has the same value as + // the [attached_resource] field. Only for default policy, this field has + // the different value. + string applied_resource = 5; + + // List of rules for this organization policy. + repeated Rule rules = 2; + + // If `inherit_from_parent` is true, Rules set higher up in the + // hierarchy (up to the closest root) are inherited and present in the + // effective policy. If it is false, then no rules are inherited, and this + // policy becomes the effective root for evaluation. + bool inherit_from_parent = 3; + + // Ignores policies set above this resource and restores the default behavior + // of the constraint at this resource. + // This field can be set in policies for either list or boolean + // constraints. If set, `rules` must be empty and `inherit_from_parent` + // must be set to false. + bool reset = 4; +} + +// The organization policy constraint definition. +message AnalyzerOrgPolicyConstraint { + // The definition of a constraint. + message Constraint { + // Specifies the default behavior in the absence of any `Policy` for the + // `Constraint`. This must not be `CONSTRAINT_DEFAULT_UNSPECIFIED`. + enum ConstraintDefault { + // This is only used for distinguishing unset values and should never be + // used. + CONSTRAINT_DEFAULT_UNSPECIFIED = 0; + + // Indicate that all values are allowed for list constraints. + // Indicate that enforcement is off for boolean constraints. + ALLOW = 1; + + // Indicate that all values are denied for list constraints. + // Indicate that enforcement is on for boolean constraints. + DENY = 2; + } + + // A `Constraint` that allows or disallows a list of string values, which + // are configured by an organization's policy administrator with a `Policy`. + message ListConstraint { + // Indicates whether values grouped into categories can be used in + // `Policy.allowed_values` and `Policy.denied_values`. For example, + // `"in:Python"` would match any value in the 'Python' group. + bool supports_in = 1; + + // Indicates whether subtrees of Cloud Resource Manager resource hierarchy + // can be used in `Policy.allowed_values` and `Policy.denied_values`. For + // example, `"under:folders/123"` would match any resource under the + // 'folders/123' folder. + bool supports_under = 2; + } + + // A `Constraint` that is either enforced or not. + // + // For example a constraint `constraints/compute.disableSerialPortAccess`. + // If it is enforced on a VM instance, serial port connections will not be + // opened to that instance. + message BooleanConstraint {} + + // The unique name of the constraint. Format of the name should be + // * `constraints/{constraint_name}` + // + // For example, `constraints/compute.disableSerialPortAccess`. + string name = 1; + + // The human readable name of the constraint. + string display_name = 2; + + // Detailed description of what this `Constraint` controls as well as how + // and where it is enforced. + string description = 3; + + // The evaluation behavior of this constraint in the absence of 'Policy'. + ConstraintDefault constraint_default = 4; + + // The type of restrictions for this `Constraint`. + // + // Immutable after creation. + oneof constraint_type { + // Defines this constraint as being a ListConstraint. + ListConstraint list_constraint = 5; + + // Defines this constraint as being a BooleanConstraint. + BooleanConstraint boolean_constraint = 6; + } + } + + // The definition of a custom constraint. + message CustomConstraint { + // The operation in which this constraint will be applied. For example: + // If the constraint applies only when create VMs, the method_types will be + // "CREATE" only. If the constraint applied when create or delete VMs, the + // method_types will be "CREATE" and "DELETE". + enum MethodType { + // Unspecified. Will results in user error. + METHOD_TYPE_UNSPECIFIED = 0; + + // Constraint applied when creating the resource. + CREATE = 1; + + // Constraint applied when updating the resource. + UPDATE = 2; + + // Constraint applied when deleting the resource. + DELETE = 3; + } + + // Allow or deny type. + enum ActionType { + // Unspecified. Will results in user error. + ACTION_TYPE_UNSPECIFIED = 0; + + // Allowed action type. + ALLOW = 1; + + // Deny action type. + DENY = 2; + } + + // Name of the constraint. This is unique within the organization. Format of + // the name should be + // * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` + // + // Example : + // "organizations/123/customConstraints/custom.createOnlyE2TypeVms" + string name = 1; + + // The Resource Instance type on which this policy applies to. Format will + // be of the form : "/" Example: + // * `compute.googleapis.com/Instance`. + repeated string resource_types = 2; + + // All the operations being applied for this constraint. + repeated MethodType method_types = 3; + + // Organization Policy condition/expression. For example: + // `resource.instanceName.matches("[production|test]_.*_(\d)+")'` or, + // `resource.management.auto_upgrade == true` + string condition = 4; + + // Allow or deny type. + ActionType action_type = 5; + + // One line display name for the UI. + string display_name = 6; + + // Detailed information about this custom policy constraint. + string description = 7; + } + + oneof constraint_definition { + // The definition of the canned constraint defined by Google. + Constraint google_defined_constraint = 1; + + // The definition of the custom constraint. + CustomConstraint custom_constraint = 2; + } +} + +// A request message for +// [AssetService.AnalyzeOrgPolicies][google.cloud.asset.v1.AssetService.AnalyzeOrgPolicies]. +message AnalyzeOrgPoliciesRequest { + // Required. The organization to scope the request. Only organization + // policies within the scope will be analyzed. + // + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the constraint to analyze organization policies for. + // The response only contains analyzed organization policies for the provided + // constraint. + string constraint = 2 [(google.api.field_behavior) = REQUIRED]; + + // The expression to filter + // [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + // Filtering is currently available for bare literal values and the following + // fields: + // * consolidated_policy.attached_resource + // * consolidated_policy.rules.enforce + // + // When filtering by a specific field, the only supported operator is `=`. + // For example, filtering by + // consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + // will return all the Organization Policy results attached to "folders/001". + string filter = 3; + + // The maximum number of items to return per page. If unspecified, + // [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results] + // will contain 20 items with a maximum of 200. + optional int32 page_size = 4; + + // The pagination token to retrieve the next page. + string page_token = 5; +} + +// The response message for +// [AssetService.AnalyzeOrgPolicies][google.cloud.asset.v1.AssetService.AnalyzeOrgPolicies]. +message AnalyzeOrgPoliciesResponse { + // The organization policy result to the query. + message OrgPolicyResult { + // The consolidated organization policy for the analyzed resource. The + // consolidated organization policy is computed by merging and evaluating + // [AnalyzeOrgPoliciesResponse.policy_bundle][]. + // The evaluation will respect the organization policy [hierarchy + // rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + AnalyzerOrgPolicy consolidated_policy = 1; + + // The ordered list of all organization policies from the + // [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + // to the scope specified in the request. + // + // If the constraint is defined with default policy, it will also appear in + // the list. + repeated AnalyzerOrgPolicy policy_bundle = 2; + + // The project that this consolidated policy belongs to, in the format of + // projects/{PROJECT_NUMBER}. This field is available when the consolidated + // policy belongs to a project. + string project = 3; + + // The folder(s) that this consolidated policy belongs to, in the format of + // folders/{FOLDER_NUMBER}. This field is available when the consolidated + // policy belongs (directly or cascadingly) to one or more folders. + repeated string folders = 4; + + // The organization that this consolidated policy belongs to, in the format + // of organizations/{ORGANIZATION_NUMBER}. This field is available when the + // consolidated policy belongs (directly or cascadingly) to an organization. + string organization = 5; + } + + // The organization policies under the + // [AnalyzeOrgPoliciesRequest.scope][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.scope] + // with the + // [AnalyzeOrgPoliciesRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.constraint]. + repeated OrgPolicyResult org_policy_results = 1; + + // The definition of the constraint in the request. + AnalyzerOrgPolicyConstraint constraint = 2; + + // The page token to fetch the next page for + // [AnalyzeOrgPoliciesResponse.org_policy_results][google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results]. + string next_page_token = 3; +} + +// A request message for +// [AssetService.AnalyzeOrgPolicyGovernedContainers][google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedContainers]. +message AnalyzeOrgPolicyGovernedContainersRequest { + // Required. The organization to scope the request. Only organization + // policies within the scope will be analyzed. The output containers will + // also be limited to the ones governed by those in-scope organization + // policies. + // + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the constraint to analyze governed containers for. + // The analysis only contains organization policies for the provided + // constraint. + string constraint = 2 [(google.api.field_behavior) = REQUIRED]; + + // The expression to filter + // [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + // Filtering is currently available for bare literal values and the following + // fields: + // * parent + // * consolidated_policy.rules.enforce + // + // When filtering by a specific field, the only supported operator is `=`. + // For example, filtering by + // parent="//cloudresourcemanager.googleapis.com/folders/001" + // will return all the containers under "folders/001". + string filter = 3; + + // The maximum number of items to return per page. If unspecified, + // [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers] + // will contain 100 items with a maximum of 200. + optional int32 page_size = 4; + + // The pagination token to retrieve the next page. + string page_token = 5; +} + +// The response message for +// [AssetService.AnalyzeOrgPolicyGovernedContainers][google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedContainers]. +message AnalyzeOrgPolicyGovernedContainersResponse { + // The organization/folder/project resource governed by organization policies + // of + // [AnalyzeOrgPolicyGovernedContainersRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest.constraint]. + message GovernedContainer { + // The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + // an organization/folder/project resource. + string full_resource_name = 1; + + // The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + // the parent of + // [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.full_resource_name]. + string parent = 2; + + // The consolidated organization policy for the analyzed resource. The + // consolidated organization policy is computed by merging and evaluating + // [AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policy_bundle]. + // The evaluation will respect the organization policy [hierarchy + // rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + AnalyzerOrgPolicy consolidated_policy = 3; + + // The ordered list of all organization policies from the + // [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][]. + // to the scope specified in the request. + // + // If the constraint is defined with default policy, it will also appear in + // the list. + repeated AnalyzerOrgPolicy policy_bundle = 4; + + // The project that this resource belongs to, in the format of + // projects/{PROJECT_NUMBER}. This field is available when the resource + // belongs to a project. + string project = 5; + + // The folder(s) that this resource belongs to, in the format of + // folders/{FOLDER_NUMBER}. This field is available when the resource + // belongs (directly or cascadingly) to one or more folders. + repeated string folders = 6; + + // The organization that this resource belongs to, in the format of + // organizations/{ORGANIZATION_NUMBER}. This field is available when the + // resource belongs (directly or cascadingly) to an organization. + string organization = 7; + + // The effective tags on this resource. + repeated EffectiveTagDetails effective_tags = 8; + } + + // The list of the analyzed governed containers. + repeated GovernedContainer governed_containers = 1; + + // The definition of the constraint in the request. + AnalyzerOrgPolicyConstraint constraint = 2; + + // The page token to fetch the next page for + // [AnalyzeOrgPolicyGovernedContainersResponse.governed_containers][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers]. + string next_page_token = 3; +} + +// A request message for +// [AssetService.AnalyzeOrgPolicyGovernedAssets][google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedAssets]. +message AnalyzeOrgPolicyGovernedAssetsRequest { + // Required. The organization to scope the request. Only organization + // policies within the scope will be analyzed. The output assets will + // also be limited to the ones governed by those in-scope organization + // policies. + // + // * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the constraint to analyze governed assets for. The + // analysis only contains analyzed organization policies for the provided + // constraint. + string constraint = 2 [(google.api.field_behavior) = REQUIRED]; + + // The expression to filter + // [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + // + // For governed resources, filtering is currently available for bare literal + // values and the following fields: + // * governed_resource.project + // * governed_resource.folders + // * consolidated_policy.rules.enforce + // When filtering by `governed_resource.project` or + // `consolidated_policy.rules.enforce`, the only supported operator is `=`. + // When filtering by `governed_resource.folders`, the supported operators + // are `=` and `:`. + // For example, filtering by `governed_resource.project="projects/12345678"` + // will return all the governed resources under "projects/12345678", + // including the project itself if applicable. + // + // For governed IAM policies, filtering is currently available for bare + // literal values and the following fields: + // * governed_iam_policy.project + // * governed_iam_policy.folders + // * consolidated_policy.rules.enforce + // When filtering by `governed_iam_policy.project` or + // `consolidated_policy.rules.enforce`, the only supported operator is `=`. + // When filtering by `governed_iam_policy.folders`, the supported operators + // are `=` and `:`. + // For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + // will return all the governed IAM policies under "folders/001". + string filter = 3; + + // The maximum number of items to return per page. If unspecified, + // [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets] + // will contain 100 items with a maximum of 200. + optional int32 page_size = 4; + + // The pagination token to retrieve the next page. + string page_token = 5; +} + +// The response message for +// [AssetService.AnalyzeOrgPolicyGovernedAssets][google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedAssets]. +message AnalyzeOrgPolicyGovernedAssetsResponse { + // The Google Cloud resources governed by the organization policies of the + // [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + message GovernedResource { + // The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + // the Google Cloud resource. + string full_resource_name = 1; + + // The [full resource name] + // (https://cloud.google.com/asset-inventory/docs/resource-name-format) of + // the parent of + // [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name]. + string parent = 2; + + // The project that this resource belongs to, in the format of + // projects/{PROJECT_NUMBER}. This field is available when the resource + // belongs to a project. + string project = 5; + + // The folder(s) that this resource belongs to, in the format of + // folders/{FOLDER_NUMBER}. This field is available when the resource + // belongs (directly or cascadingly) to one or more folders. + repeated string folders = 6; + + // The organization that this resource belongs to, in the format of + // organizations/{ORGANIZATION_NUMBER}. This field is available when the + // resource belongs (directly or cascadingly) to an organization. + string organization = 7; + + // The asset type of the + // [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.full_resource_name] + // Example: + // `cloudresourcemanager.googleapis.com/Project` + // See [Cloud Asset Inventory Supported Asset + // Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for all supported asset types. + string asset_type = 8; + + // The effective tags on this resource. + repeated EffectiveTagDetails effective_tags = 9; + } + + // The IAM policies governed by the organization policies of the + // [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + message GovernedIamPolicy { + // The full resource name of the resource on which this IAM policy is set. + // Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Cloud Asset Inventory Resource Name + // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // for more information. + string attached_resource = 1; + + // The IAM policy directly set on the given resource. + google.iam.v1.Policy policy = 2; + + // The project that this IAM policy belongs to, in the format of + // projects/{PROJECT_NUMBER}. This field is available when the IAM policy + // belongs to a project. + string project = 5; + + // The folder(s) that this IAM policy belongs to, in the format of + // folders/{FOLDER_NUMBER}. This field is available when the IAM policy + // belongs (directly or cascadingly) to one or more folders. + repeated string folders = 6; + + // The organization that this IAM policy belongs to, in the format of + // organizations/{ORGANIZATION_NUMBER}. This field is available when the + // IAM policy belongs (directly or cascadingly) to an organization. + string organization = 7; + + // The asset type of the + // [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.attached_resource]. + // Example: + // `cloudresourcemanager.googleapis.com/Project` + // See [Cloud Asset Inventory Supported Asset + // Types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for all supported asset types. + string asset_type = 8; + } + + // Represents a Google Cloud asset(resource or IAM policy) governed by the + // organization policies of the + // [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + message GovernedAsset { + oneof governed_asset { + // A Google Cloud resource governed by the organization + // policies of the + // [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + GovernedResource governed_resource = 1; + + // An IAM policy governed by the organization + // policies of the + // [AnalyzeOrgPolicyGovernedAssetsRequest.constraint][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.constraint]. + GovernedIamPolicy governed_iam_policy = 2; + } + + // The consolidated policy for the analyzed asset. The consolidated + // policy is computed by merging and evaluating + // [AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policy_bundle]. + // The evaluation will respect the organization policy [hierarchy + // rules](https://cloud.google.com/resource-manager/docs/organization-policy/understanding-hierarchy). + AnalyzerOrgPolicy consolidated_policy = 3; + + // The ordered list of all organization policies from the + // [AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidated_policy.attached_resource][] + // to the scope specified in the request. + // + // If the constraint is defined with default policy, it will also appear in + // the list. + repeated AnalyzerOrgPolicy policy_bundle = 4; + } + + // The list of the analyzed governed assets. + repeated GovernedAsset governed_assets = 1; + + // The definition of the constraint in the request. + AnalyzerOrgPolicyConstraint constraint = 2; + + // The page token to fetch the next page for + // [AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets][google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets]. + string next_page_token = 3; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; + + // The organization policy set on an asset. + ORG_POLICY = 4; + + // The Access Context Manager policy set on an asset. + ACCESS_POLICY = 5; + + // The runtime OS Inventory information. + OS_INVENTORY = 6; + + // The related resources. + RELATIONSHIP = 7; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/asset/v1/assets.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/asset/v1/assets.proto new file mode 100644 index 00000000000..336eda2fa04 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/asset/v1/assets.proto @@ -0,0 +1,1031 @@ +// Copyright 2024 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.v1; + +import "google/api/resource.proto"; +import "google/cloud/orgpolicy/v1/orgpolicy.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/code.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.V1"; +option go_package = "cloud.google.com/go/asset/apiv1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1"; +option php_namespace = "Google\\Cloud\\Asset\\V1"; + +// An asset in Google Cloud and its temporal metadata, including the time window +// when it was observed and its status during that window. +message TemporalAsset { + // State of prior asset. + enum PriorAssetState { + // prior_asset is not applicable for the current asset. + PRIOR_ASSET_STATE_UNSPECIFIED = 0; + + // prior_asset is populated correctly. + PRESENT = 1; + + // Failed to set prior_asset. + INVALID = 2; + + // Current asset is the first known state. + DOES_NOT_EXIST = 3; + + // prior_asset is a deletion. + DELETED = 4; + } + + // The time window when the asset data and state was observed. + TimeWindow window = 1; + + // Whether the asset has been deleted or not. + bool deleted = 2; + + // An asset in Google Cloud. + Asset asset = 3; + + // State of prior_asset. + PriorAssetState prior_asset_state = 4; + + // Prior copy of the asset. Populated if prior_asset_state is PRESENT. + // Currently this is only set for responses in Real-Time Feed. + Asset prior_asset = 5; +} + +// A time window specified by its `start_time` and `end_time`. +message TimeWindow { + // Start time of the time window (exclusive). + google.protobuf.Timestamp start_time = 1; + + // End time of the time window (inclusive). If not specified, the current + // timestamp is used instead. + google.protobuf.Timestamp end_time = 2; +} + +// An asset in Google Cloud. An asset can be any resource in the Google Cloud +// [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy), +// or a relationship (e.g. an INSTANCE_TO_INSTANCEGROUP relationship). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + + // The last update timestamp of an asset. update_time is updated when + // create/update/delete operation is performed. + google.protobuf.Timestamp update_time = 11; + + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // A representation of the resource. + Resource resource = 3; + + // A representation of the IAM policy set on a Google Cloud resource. + // There can be a maximum of one IAM policy set on any given resource. + // In addition, IAM policies inherit their granted access scope from any + // policies set on parent resources in the resource hierarchy. Therefore, the + // effectively policy is the union of both the policy set on this resource + // and each policy set on all of the resource's ancestry resource levels in + // the hierarchy. See + // [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + // for more information. + google.iam.v1.Policy iam_policy = 4; + + // A representation of an [organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + // There can be more than one organization policy with different constraints + // set on a given resource. + repeated google.cloud.orgpolicy.v1.Policy org_policy = 6; + + // A representation of an [access + // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + oneof access_context_policy { + // Also refer to the [access policy user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + + // Also refer to the [access level user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). + google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + + // Also refer to the [service perimeter user + // guide](https://cloud.google.com/vpc-service-controls/docs/overview). + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; + } + + // A representation of runtime OS Inventory information. See [this + // topic](https://cloud.google.com/compute/docs/instances/os-inventory-management) + // for more information. + google.cloud.osconfig.v1.Inventory os_inventory = 12; + + // DEPRECATED. This field only presents for the purpose of + // backward-compatibility. The server will never generate responses with this + // field. + // The related assets of the asset of one relationship type. One asset + // only represents one type of relationship. + RelatedAssets related_assets = 13 [deprecated = true]; + + // One related asset of the current asset. + RelatedAsset related_asset = 15; + + // The ancestry path of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. If the asset + // is a project, folder, or organization, the ancestry path starts from the + // asset itself. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 10; +} + +// A representation of a Google Cloud resource. +message Resource { + // The API version. Example: `v1` + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // Example: + // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. Example: + // `Project` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP `GET` request using this + // URL returns the resource itself. Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + // + // This value is unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + // + // For Google Cloud assets, this value is the parent resource defined in the + // [IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // Example: + // `//cloudresourcemanager.googleapis.com/projects/my_project_123` + string parent = 5; + + // The content of the resource, in which some sensitive fields are removed + // and may not be present. + google.protobuf.Struct data = 6; + + // The location of the resource in Google Cloud, such as its zone and region. + // For more information, see https://cloud.google.com/about/locations/. + string location = 8; +} + +// DEPRECATED. This message only presents for the purpose of +// backward-compatibility. The server will never populate this message in +// responses. +// The detailed related assets with the `relationship_type`. +message RelatedAssets { + option deprecated = true; + + // The detailed relationship attributes. + RelationshipAttributes relationship_attributes = 1; + + // The peer resources of the relationship. + repeated RelatedAsset assets = 2; +} + +// DEPRECATED. This message only presents for the purpose of +// backward-compatibility. The server will never populate this message in +// responses. +// The relationship attributes which include `type`, `source_resource_type`, +// `target_resource_type` and `action`. +message RelationshipAttributes { + option deprecated = true; + + // The unique identifier of the relationship type. Example: + // `INSTANCE_TO_INSTANCEGROUP` + string type = 4; + + // The source asset type. Example: `compute.googleapis.com/Instance` + string source_resource_type = 1; + + // The target asset type. Example: `compute.googleapis.com/Disk` + string target_resource_type = 2; + + // The detail of the relationship, e.g. `contains`, `attaches` + string action = 3; +} + +// An asset identifier in Google Cloud which contains its name, type and +// ancestors. An asset can be any resource in the Google Cloud [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message RelatedAsset { + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string asset = 1 [(google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Asset" + }]; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // The ancestors of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 3; + + // The unique identifier of the relationship type. Example: + // `INSTANCE_TO_INSTANCEGROUP` + string relationship_type = 4; +} + +// The key and value for a +// [tag](https://cloud.google.com/resource-manager/docs/tags/tags-overview). +message Tag { + // TagKey namespaced name, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + optional string tag_key = 1; + + // TagKey ID, in the format of tagKeys/{TAG_KEY_ID}. + optional string tag_key_id = 2; + + // TagValue namespaced name, in the format of + // {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + optional string tag_value = 3; + + // TagValue ID, in the format of tagValues/{TAG_VALUE_ID}. + optional string tag_value_id = 4; +} + +// The effective tags and the ancestor resources from which they were inherited. +message EffectiveTagDetails { + // The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of the ancestor from which an [effective_tag][] is inherited, according to + // [tag + // inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + optional string attached_resource = 1; + + // The effective tags inherited from the + // [attached_resource][google.cloud.asset.v1.EffectiveTagDetails.attached_resource]. + // Note that tags with the same key but different values may attach to + // resources at a different hierarchy levels. The lower hierarchy tag value + // will overwrite the higher hierarchy tag value of the same tag key. In this + // case, the tag value at the higher hierarchy level will be removed. For more + // information, see [tag + // inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + repeated Tag effective_tags = 2; +} + +// A result of Resource Search, containing information of a cloud resource. +message ResourceSearchResult { + // The full resource name of this resource. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Cloud Asset Inventory Resource Name + // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // for more information. + // + // To search against the `name`: + // + // * Use a field query. Example: `name:instance1` + // * Use a free text query. Example: `instance1` + string name = 1; + + // The type of this resource. Example: `compute.googleapis.com/Disk`. + // + // To search against the `asset_type`: + // + // * Specify the `asset_type` field in your search request. + string asset_type = 2; + + // The project that this resource belongs to, in the form of + // projects/{PROJECT_NUMBER}. This field is available when the resource + // belongs to a project. + // + // To search against `project`: + // + // * Use a field query. Example: `project:12345` + // * Use a free text query. Example: `12345` + // * Specify the `scope` field as this project in your search request. + string project = 3; + + // The folder(s) that this resource belongs to, in the form of + // folders/{FOLDER_NUMBER}. This field is available when the resource + // belongs to one or more folders. + // + // To search against `folders`: + // + // * Use a field query. Example: `folders:(123 OR 456)` + // * Use a free text query. Example: `123` + // * Specify the `scope` field as this folder in your search request. + repeated string folders = 17; + + // The organization that this resource belongs to, in the form of + // organizations/{ORGANIZATION_NUMBER}. This field is available when the + // resource belongs to an organization. + // + // To search against `organization`: + // + // * Use a field query. Example: `organization:123` + // * Use a free text query. Example: `123` + // * Specify the `scope` field as this organization in your search request. + string organization = 18; + + // The display name of this resource. This field is available only when the + // resource's Protobuf contains it. + // + // To search against the `display_name`: + // + // * Use a field query. Example: `displayName:"My Instance"` + // * Use a free text query. Example: `"My Instance"` + string display_name = 4; + + // One or more paragraphs of text description of this resource. Maximum length + // could be up to 1M bytes. This field is available only when the resource's + // Protobuf contains it. + // + // To search against the `description`: + // + // * Use a field query. Example: `description:"important instance"` + // * Use a free text query. Example: `"important instance"` + string description = 5; + + // Location can be `global`, regional like `us-east1`, or zonal like + // `us-west1-b`. This field is available only when the resource's Protobuf + // contains it. + // + // To search against the `location`: + // + // * Use a field query. Example: `location:us-west*` + // * Use a free text query. Example: `us-west*` + string location = 6; + + // User labels associated with this resource. See [Labelling and grouping + // Google Cloud + // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. This field is available only when the resource's + // Protobuf contains it. + // + // To search against the `labels`: + // + // * Use a field query: + // - query on any label's key or value. Example: `labels:prod` + // - query by a given label. Example: `labels.env:prod` + // - query by a given label's existence. Example: `labels.env:*` + // * Use a free text query. Example: `prod` + map labels = 7; + + // Network tags associated with this resource. Like labels, network tags are a + // type of annotations used to group Google Cloud resources. See [Labelling + // Google Cloud + // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. This field is available only when the resource's + // Protobuf contains it. + // + // To search against the `network_tags`: + // + // * Use a field query. Example: `networkTags:internal` + // * Use a free text query. Example: `internal` + repeated string network_tags = 8; + + // The Cloud KMS + // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + // name or + // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + // name. + // + // This field only presents for the purpose of backward compatibility. + // Use the `kms_keys` field to retrieve Cloud KMS key information. This field + // is available only when the resource's Protobuf contains it and will only be + // populated for [these resource + // types](https://cloud.google.com/asset-inventory/docs/legacy-field-names#resource_types_with_the_to_be_deprecated_kmskey_field) + // for backward compatible purposes. + // + // To search against the `kms_key`: + // + // * Use a field query. Example: `kmsKey:key` + // * Use a free text query. Example: `key` + string kms_key = 10 [deprecated = true]; + + // The Cloud KMS + // [CryptoKey](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys) + // names or + // [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions) + // names. This field is available only when the resource's Protobuf contains + // it. + // + // To search against the `kms_keys`: + // + // * Use a field query. Example: `kmsKeys:key` + // * Use a free text query. Example: `key` + repeated string kms_keys = 28; + + // The create timestamp of this resource, at which the resource was created. + // The granularity is in seconds. Timestamp.nanos will always be 0. This field + // is available only when the resource's Protobuf contains it. + // + // To search against `create_time`: + // + // * Use a field query. + // - value in seconds since unix epoch. Example: `createTime > 1609459200` + // - value in date string. Example: `createTime > 2021-01-01` + // - value in date-time string (must be quoted). Example: `createTime > + // "2021-01-01T00:00:00"` + google.protobuf.Timestamp create_time = 11; + + // The last update timestamp of this resource, at which the resource was last + // modified or deleted. The granularity is in seconds. Timestamp.nanos will + // always be 0. This field is available only when the resource's Protobuf + // contains it. + // + // To search against `update_time`: + // + // * Use a field query. + // - value in seconds since unix epoch. Example: `updateTime < 1609459200` + // - value in date string. Example: `updateTime < 2021-01-01` + // - value in date-time string (must be quoted). Example: `updateTime < + // "2021-01-01T00:00:00"` + google.protobuf.Timestamp update_time = 12; + + // The state of this resource. Different resources types have different state + // definitions that are mapped from various fields of different resource + // types. This field is available only when the resource's Protobuf contains + // it. + // + // Example: + // If the resource is an instance provided by Compute Engine, + // its state will include PROVISIONING, STAGING, RUNNING, STOPPING, + // SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See `status` definition + // in [API + // Reference](https://cloud.google.com/compute/docs/reference/rest/v1/instances). + // If the resource is a project provided by Resource Manager, its state + // will include LIFECYCLE_STATE_UNSPECIFIED, ACTIVE, DELETE_REQUESTED and + // DELETE_IN_PROGRESS. See `lifecycleState` definition in [API + // Reference](https://cloud.google.com/resource-manager/reference/rest/v1/projects). + // + // To search against the `state`: + // + // * Use a field query. Example: `state:RUNNING` + // * Use a free text query. Example: `RUNNING` + string state = 13; + + // The additional searchable attributes of this resource. The attributes may + // vary from one resource type to another. Examples: `projectId` for Project, + // `dnsName` for DNS ManagedZone. This field contains a subset of the resource + // metadata fields that are returned by the List or Get APIs provided by the + // corresponding Google Cloud service (e.g., Compute Engine). see [API + // references and supported searchable + // attributes](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // to see which fields are included. + // + // You can search values of these fields through free text search. However, + // you should not consume the field programically as the field names and + // values may change as the Google Cloud service updates to a new incompatible + // API version. + // + // To search against the `additional_attributes`: + // + // * Use a free text query to match the attributes values. Example: to search + // `additional_attributes = { dnsName: "foobar" }`, you can issue a query + // `foobar`. + google.protobuf.Struct additional_attributes = 9; + + // The full resource name of this resource's parent, if it has one. + // To search against the `parent_full_resource_name`: + // + // * Use a field query. Example: + // `parentFullResourceName:"project-name"` + // * Use a free text query. Example: + // `project-name` + string parent_full_resource_name = 19; + + // Versioned resource representations of this resource. This is repeated + // because there could be multiple versions of resource representations during + // version migration. + // + // This `versioned_resources` field is not searchable. Some attributes of the + // resource representations are exposed in `additional_attributes` field, so + // as to allow users to search on them. + repeated VersionedResource versioned_resources = 16; + + // Attached resources of this resource. For example, an OSConfig + // Inventory is an attached resource of a Compute Instance. This field is + // repeated because a resource could have multiple attached resources. + // + // This `attached_resources` field is not searchable. Some attributes + // of the attached resources are exposed in `additional_attributes` field, so + // as to allow users to search on them. + repeated AttachedResource attached_resources = 20; + + // A map of related resources of this resource, keyed by the + // relationship type. A relationship type is in the format of + // {SourceType}_{ACTION}_{DestType}. Example: `DISK_TO_INSTANCE`, + // `DISK_TO_NETWORK`, `INSTANCE_TO_INSTANCEGROUP`. + // See [supported relationship + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types#supported_relationship_types). + map relationships = 21; + + // This field is only present for the purpose of backward compatibility. + // Use the `tags` field instead. + // + // TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. + // To search against the `tagKeys`: + // + // * Use a field query. Example: + // - `tagKeys:"123456789/env*"` + // - `tagKeys="123456789/env"` + // - `tagKeys:"env"` + // + // * Use a free text query. Example: + // - `env` + repeated string tag_keys = 23 [deprecated = true]; + + // This field is only present for the purpose of backward compatibility. + // Use the `tags` field instead. + // + // TagValue namespaced names, in the format of + // {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + // To search against the `tagValues`: + // + // * Use a field query. Example: + // - `tagValues:"env"` + // - `tagValues:"env/prod"` + // - `tagValues:"123456789/env/prod*"` + // - `tagValues="123456789/env/prod"` + // + // * Use a free text query. Example: + // - `prod` + repeated string tag_values = 25 [deprecated = true]; + + // This field is only present for the purpose of backward compatibility. + // Use the `tags` field instead. + // + // TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. + // To search against the `tagValueIds`: + // + // * Use a field query. Example: + // - `tagValueIds="tagValues/456"` + // + // * Use a free text query. Example: + // - `456` + repeated string tag_value_ids = 26 [deprecated = true]; + + // The tags directly attached to this resource. + // + // To search against the `tags`: + // + // * Use a field query. Example: + // - `tagKeys:"123456789/env*"` + // - `tagKeys="123456789/env"` + // - `tagKeys:"env"` + // - `tagKeyIds="tagKeys/123"` + // - `tagValues:"env"` + // - `tagValues:"env/prod"` + // - `tagValues:"123456789/env/prod*"` + // - `tagValues="123456789/env/prod"` + // - `tagValueIds="tagValues/456"` + // + // * Use a free text query. Example: + // - `env/prod` + repeated Tag tags = 29; + + // The effective tags on this resource. All of the tags that are both attached + // to and inherited by a resource are collectively called the effective + // tags. For more information, see [tag + // inheritance](https://cloud.google.com/resource-manager/docs/tags/tags-overview#inheritance). + // + // To search against the `effective_tags`: + // + // * Use a field query. Example: + // - `effectiveTagKeys:"123456789/env*"` + // - `effectiveTagKeys="123456789/env"` + // - `effectiveTagKeys:"env"` + // - `effectiveTagKeyIds="tagKeys/123"` + // - `effectiveTagValues:"env"` + // - `effectiveTagValues:"env/prod"` + // - `effectiveTagValues:"123456789/env/prod*"` + // - `effectiveTagValues="123456789/env/prod"` + // - `effectiveTagValueIds="tagValues/456"` + repeated EffectiveTagDetails effective_tags = 30; + + // The type of this resource's immediate parent, if there is one. + // + // To search against the `parent_asset_type`: + // + // * Use a field query. Example: + // `parentAssetType:"cloudresourcemanager.googleapis.com/Project"` + // * Use a free text query. Example: + // `cloudresourcemanager.googleapis.com/Project` + string parent_asset_type = 103; + + // The actual content of Security Command Center security marks associated + // with the asset. + // + // + // To search against SCC SecurityMarks field: + // + // * Use a field query: + // - query by a given key value pair. Example: `sccSecurityMarks.foo=bar` + // - query by a given key's existence. Example: `sccSecurityMarks.foo:*` + map scc_security_marks = 32; +} + +// Resource representation as defined by the corresponding service providing the +// resource for a given API version. +message VersionedResource { + // API version of the resource. + // + // Example: + // If the resource is an instance provided by Compute Engine v1 API as defined + // in `https://cloud.google.com/compute/docs/reference/rest/v1/instances`, + // version will be "v1". + string version = 1; + + // JSON representation of the resource as defined by the corresponding + // service providing this resource. + // + // Example: + // If the resource is an instance provided by Compute Engine, this field will + // contain the JSON representation of the instance as defined by Compute + // Engine: + // `https://cloud.google.com/compute/docs/reference/rest/v1/instances`. + // + // You can find the resource definition for each supported resource type in + // this table: + // `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + google.protobuf.Struct resource = 2; +} + +// Attached resource representation, which is defined by the corresponding +// service provider. It represents an attached resource's payload. +message AttachedResource { + // The type of this attached resource. + // + // Example: `osconfig.googleapis.com/Inventory` + // + // You can find the supported attached asset types of each resource in this + // table: + // `https://cloud.google.com/asset-inventory/docs/supported-asset-types` + string asset_type = 1; + + // Versioned resource representations of this attached resource. This is + // repeated because there could be multiple versions of the attached resource + // representations during version migration. + repeated VersionedResource versioned_resources = 3; +} + +// The related resources of the primary resource. +message RelatedResources { + // The detailed related resources of the primary resource. + repeated RelatedResource related_resources = 1; +} + +// The detailed related resource. +message RelatedResource { + // The type of the asset. Example: `compute.googleapis.com/Instance` + string asset_type = 1; + + // The full resource name of the related resource. Example: + // `//compute.googleapis.com/projects/my_proj_123/zones/instance/instance123` + string full_resource_name = 2; +} + +// A result of IAM Policy search, containing information of an IAM policy. +message IamPolicySearchResult { + // Explanation about the IAM policy search result. + message Explanation { + // IAM permissions + message Permissions { + // A list of permissions. A sample permission string: `compute.disk.get`. + repeated string permissions = 1; + } + + // The map from roles to their included permissions that match the + // permission query (i.e., a query containing `policy.role.permissions:`). + // Example: if query `policy.role.permissions:compute.disk.get` + // matches a policy binding that contains owner role, the + // matched_permissions will be `{"roles/owner": ["compute.disk.get"]}`. The + // roles can also be found in the returned `policy` bindings. Note that the + // map is populated only for requests with permission queries. + map matched_permissions = 1; + } + + // The full resource name of the resource associated with this IAM policy. + // Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Cloud Asset Inventory Resource Name + // Format](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // for more information. + // + // To search against the `resource`: + // + // * use a field query. Example: `resource:organizations/123` + string resource = 1; + + // The type of the resource associated with this IAM policy. Example: + // `compute.googleapis.com/Disk`. + // + // To search against the `asset_type`: + // + // * specify the `asset_types` field in your search request. + string asset_type = 5; + + // The project that the associated Google Cloud resource belongs to, in the + // form of projects/{PROJECT_NUMBER}. If an IAM policy is set on a resource + // (like VM instance, Cloud Storage bucket), the project field will indicate + // the project that contains the resource. If an IAM policy is set on a folder + // or orgnization, this field will be empty. + // + // To search against the `project`: + // + // * specify the `scope` field as this project in your search request. + string project = 2; + + // The folder(s) that the IAM policy belongs to, in the form of + // folders/{FOLDER_NUMBER}. This field is available when the IAM policy + // belongs to one or more folders. + // + // To search against `folders`: + // + // * use a field query. Example: `folders:(123 OR 456)` + // * use a free text query. Example: `123` + // * specify the `scope` field as this folder in your search request. + repeated string folders = 6; + + // The organization that the IAM policy belongs to, in the form + // of organizations/{ORGANIZATION_NUMBER}. This field is available when the + // IAM policy belongs to an organization. + // + // To search against `organization`: + // + // * use a field query. Example: `organization:123` + // * use a free text query. Example: `123` + // * specify the `scope` field as this organization in your search request. + string organization = 7; + + // The IAM policy directly set on the given resource. Note that the original + // IAM policy can contain multiple bindings. This only contains the bindings + // that match the given query. For queries that don't contain a constrain on + // policies (e.g., an empty query), this contains all the bindings. + // + // To search against the `policy` bindings: + // + // * use a field query: + // - query by the policy contained members. Example: + // `policy:amy@gmail.com` + // - query by the policy contained roles. Example: + // `policy:roles/compute.admin` + // - query by the policy contained roles' included permissions. Example: + // `policy.role.permissions:compute.instances.create` + google.iam.v1.Policy policy = 3; + + // Explanation about the IAM policy search result. It contains additional + // information to explain why the search result matches the query. + Explanation explanation = 4; +} + +// Represents the detailed state of an entity under analysis, such as a +// resource, an identity or an access. +message IamPolicyAnalysisState { + // The Google standard error code that best describes the state. + // For example: + // - OK means the analysis on this entity has been successfully finished; + // - PERMISSION_DENIED means an access denied error is encountered; + // - DEADLINE_EXCEEDED means the analysis on this entity hasn't been started + // in time; + google.rpc.Code code = 1; + + // The human-readable description of the cause of failure. + string cause = 2; +} + +// The condition evaluation. +message ConditionEvaluation { + // Value of this expression. + enum EvaluationValue { + // Reserved for future use. + EVALUATION_VALUE_UNSPECIFIED = 0; + + // The evaluation result is `true`. + TRUE = 1; + + // The evaluation result is `false`. + FALSE = 2; + + // The evaluation result is `conditional` when the condition expression + // contains variables that are either missing input values or have not been + // supported by Policy Analyzer yet. + CONDITIONAL = 3; + } + + // The evaluation result. + EvaluationValue evaluation_value = 1; +} + +// IAM Policy analysis result, consisting of one IAM policy binding and derived +// access control lists. +message IamPolicyAnalysisResult { + // A Google Cloud resource under analysis. + message Resource { + // The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + string full_resource_name = 1; + + // The analysis state of this resource. + IamPolicyAnalysisState analysis_state = 2; + } + + // An IAM role or permission under analysis. + message Access { + oneof oneof_access { + // The role. + string role = 1; + + // The permission. + string permission = 2; + } + + // The analysis state of this access. + IamPolicyAnalysisState analysis_state = 3; + } + + // An identity under analysis. + message Identity { + // The identity of members, formatted as appear in an + // [IAM policy + // binding](https://cloud.google.com/iam/reference/rest/v1/Binding). For + // example, they might be formatted like the following: + // + // - user:foo@google.com + // - group:group1@google.com + // - serviceAccount:s1@prj1.iam.gserviceaccount.com + // - projectOwner:some_project_id + // - domain:google.com + // - allUsers + string name = 1; + + // The analysis state of this identity. + IamPolicyAnalysisState analysis_state = 2; + } + + // A directional edge. + message Edge { + // The source node of the edge. For example, it could be a full resource + // name for a resource node or an email of an identity. + string source_node = 1; + + // The target node of the edge. For example, it could be a full resource + // name for a resource node or an email of an identity. + string target_node = 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.v1.IamPolicyAnalysisResult.Edge.source_node] + // contains the full resource name of a parent resource and + // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + // contains the full resource name of a child resource. This field is + // present only if the output_resource_edges option is enabled in request. + repeated Edge resource_edges = 3; + + // Condition evaluation for this AccessControlList, if there is a condition + // defined in the above IAM policy binding. + ConditionEvaluation condition_evaluation = 4; + } + + // The identities and group edges. + 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.v1.IamPolicyAnalysisResult.IdentityList.identities]. + // The + // [Edge.source_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.source_node] + // contains a group, such as `group:parent@google.com`. The + // [Edge.target_node][google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.target_node] + // contains a member of the group, such as `group:child@google.com` or + // `user:foo@google.com`. This field is present only if the + // output_group_edges option is enabled in request. + repeated Edge group_edges = 2; + } + + // The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of the resource to which the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // policy attaches. + string attached_resource_full_name = 1; + + // The IAM policy binding under analysis. + google.iam.v1.Binding iam_binding = 2; + + // The access control lists derived from the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // that match or potentially match resource and access selectors specified in + // the request. + repeated AccessControlList access_control_lists = 3; + + // The identity list derived from members of the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // that match or potentially match identity selector specified in the request. + IdentityList identity_list = 4; + + // Represents whether all analyses on the + // [iam_binding][google.cloud.asset.v1.IamPolicyAnalysisResult.iam_binding] + // have successfully finished. + bool fully_explored = 5; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto new file mode 100644 index 00000000000..10fe86a216e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto @@ -0,0 +1,313 @@ +// Copyright 2024 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.orgpolicy.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OrgPolicy.V1"; +option go_package = "cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyProto"; +option java_package = "com.google.cloud.orgpolicy.v1"; +option php_namespace = "Google\\Cloud\\OrgPolicy\\V1"; +option ruby_package = "Google::Cloud::OrgPolicy::V1"; + +// Defines a Cloud Organization `Policy` which is used to specify `Constraints` +// for configurations of Cloud Platform resources. +message Policy { + // Used in `policy_type` to specify how `list_policy` behaves at this + // resource. + // + // `ListPolicy` can define specific values and subtrees of Cloud Resource + // Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that + // are allowed or denied by setting the `allowed_values` and `denied_values` + // fields. This is achieved by using the `under:` and optional `is:` prefixes. + // The `under:` prefix is used to denote resource subtree values. + // The `is:` prefix is used to denote specific values, and is required only + // if the value contains a ":". Values prefixed with "is:" are treated the + // same as values with no prefix. + // Ancestry subtrees must be in one of the following formats: + // - "projects/", e.g. "projects/tokyo-rain-123" + // - "folders/", e.g. "folders/1234" + // - "organizations/", e.g. "organizations/1234" + // The `supports_under` field of the associated `Constraint` defines whether + // ancestry prefixes can be used. You can set `allowed_values` and + // `denied_values` in the same `Policy` if `all_values` is + // `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all + // values. If `all_values` is set to either `ALLOW` or `DENY`, + // `allowed_values` and `denied_values` must be unset. + message ListPolicy { + // This enum can be used to set `Policies` that apply to all possible + // configuration values rather than specific values in `allowed_values` or + // `denied_values`. + // + // Settting this to `ALLOW` will mean this `Policy` allows all values. + // Similarly, setting it to `DENY` will mean no values are allowed. If + // set to either `ALLOW` or `DENY, `allowed_values` and `denied_values` + // must be unset. Setting this to `ALL_VALUES_UNSPECIFIED` allows for + // setting `allowed_values` and `denied_values`. + enum AllValues { + // Indicates that allowed_values or denied_values must be set. + ALL_VALUES_UNSPECIFIED = 0; + + // A policy with this set allows all values. + ALLOW = 1; + + // A policy with this set denies all values. + DENY = 2; + } + + // List of values allowed at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string allowed_values = 1; + + // List of values denied at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string denied_values = 2; + + // The policy all_values state. + AllValues all_values = 3; + + // Optional. The Google Cloud Console will try to default to a configuration + // that matches the value specified in this `Policy`. If `suggested_value` + // is not set, it will inherit the value specified higher in the hierarchy, + // unless `inherit_from_parent` is `false`. + string suggested_value = 4; + + // Determines the inheritance behavior for this `Policy`. + // + // By default, a `ListPolicy` set at a resource supercedes any `Policy` set + // anywhere up the resource hierarchy. However, if `inherit_from_parent` is + // set to `true`, then the values from the effective `Policy` of the parent + // resource are inherited, meaning the values set in this `Policy` are + // added to the values inherited up the hierarchy. + // + // Setting `Policy` hierarchies that inherit both allowed values and denied + // values isn't recommended in most circumstances to keep the configuration + // simple and understandable. However, it is possible to set a `Policy` with + // `allowed_values` set that inherits a `Policy` with `denied_values` set. + // In this case, the values that are allowed must be in `allowed_values` and + // not present in `denied_values`. + // + // For example, suppose you have a `Constraint` + // `constraints/serviceuser.services`, which has a `constraint_type` of + // `list_constraint`, and with `constraint_default` set to `ALLOW`. + // Suppose that at the Organization level, a `Policy` is applied that + // restricts the allowed API activations to {`E1`, `E2`}. Then, if a + // `Policy` is applied to a project below the Organization that has + // `inherit_from_parent` set to `false` and field all_values set to DENY, + // then an attempt to activate any API will be denied. + // + // The following examples demonstrate different possible layerings for + // `projects/bar` parented by `organizations/foo`: + // + // Example 1 (no inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has `inherit_from_parent` `false` and values: + // {allowed_values: "E3" allowed_values: "E4"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E3`, and `E4`. + // + // Example 2 (inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {value: "E3" value: "E4" inherit_from_parent: true} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. + // + // Example 3 (inheriting both allowed and denied values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {denied_values: "E1"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The value accepted at `projects/bar` is `E2`. + // + // Example 4 (RestoreDefault): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {RestoreDefault: {}} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 5 (no policy inherits parent policy): + // `organizations/foo` has no `Policy` set. + // `projects/bar` has no `Policy` set. + // The accepted values at both levels are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 6 (ListConstraint allowing all): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: ALLOW} + // The accepted values at `organizations/foo` are `E1`, E2`. + // Any value is accepted at `projects/bar`. + // + // Example 7 (ListConstraint allowing none): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: DENY} + // The accepted values at `organizations/foo` are `E1`, E2`. + // No value is accepted at `projects/bar`. + // + // Example 10 (allowed and denied subtrees of Resource Manager hierarchy): + // Given the following resource hierarchy + // O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "under:organizations/O1"} + // `projects/bar` has a `Policy` with: + // {allowed_values: "under:projects/P3"} + // {denied_values: "under:folders/F2"} + // The accepted values at `organizations/foo` are `organizations/O1`, + // `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`, + // `projects/P3`. + // The accepted values at `projects/bar` are `organizations/O1`, + // `folders/F1`, `projects/P1`. + bool inherit_from_parent = 5; + } + + // Used in `policy_type` to specify how `boolean_policy` will behave at this + // resource. + message BooleanPolicy { + // If `true`, then the `Policy` is enforced. If `false`, then any + // configuration is acceptable. + // + // Suppose you have a `Constraint` + // `constraints/compute.disableSerialPortAccess` with `constraint_default` + // set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following + // behavior: + // - If the `Policy` at this resource has enforced set to `false`, serial + // port connection attempts will be allowed. + // - If the `Policy` at this resource has enforced set to `true`, serial + // port connection attempts will be refused. + // - If the `Policy` at this resource is `RestoreDefault`, serial port + // connection attempts will be allowed. + // - If no `Policy` is set at this resource or anywhere higher in the + // resource hierarchy, serial port connection attempts will be allowed. + // - If no `Policy` is set at this resource, but one exists higher in the + // resource hierarchy, the behavior is as if the`Policy` were set at + // this resource. + // + // The following examples demonstrate the different possible layerings: + // + // Example 1 (nearest `Constraint` wins): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has no `Policy` set. + // The constraint at `projects/bar` and `organizations/foo` will not be + // enforced. + // + // Example 2 (enforcement gets replaced): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has a `Policy` with: + // {enforced: true} + // The constraint at `organizations/foo` is not enforced. + // The constraint at `projects/bar` is enforced. + // + // Example 3 (RestoreDefault): + // `organizations/foo` has a `Policy` with: + // {enforced: true} + // `projects/bar` has a `Policy` with: + // {RestoreDefault: {}} + // The constraint at `organizations/foo` is enforced. + // The constraint at `projects/bar` is not enforced, because + // `constraint_default` for the `Constraint` is `ALLOW`. + bool enforced = 1; + } + + // Ignores policies set above this resource and restores the + // `constraint_default` enforcement behavior of the specific `Constraint` at + // this resource. + // + // Suppose that `constraint_default` is set to `ALLOW` for the + // `Constraint` `constraints/serviceuser.services`. Suppose that organization + // foo.com sets a `Policy` at their Organization resource node that restricts + // the allowed service activations to deny all service activations. They + // could then set a `Policy` with the `policy_type` `restore_default` on + // several experimental projects, restoring the `constraint_default` + // enforcement of the `Constraint` for only those projects, allowing those + // projects to have all services activated. + message RestoreDefault { + + } + + // Version of the `Policy`. Default version is 0; + int32 version = 1; + + // The name of the `Constraint` the `Policy` is configuring, for example, + // `constraints/serviceuser.services`. + // + // Immutable after creation. + string constraint = 2; + + // An opaque tag indicating the current version of the `Policy`, used for + // concurrency control. + // + // When the `Policy` is returned from either a `GetPolicy` or a + // `ListOrgPolicy` request, this `etag` indicates the version of the current + // `Policy` to use when executing a read-modify-write loop. + // + // When the `Policy` is returned from a `GetEffectivePolicy` request, the + // `etag` will be unset. + // + // When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value + // that was returned from a `GetOrgPolicy` request as part of a + // read-modify-write loop for concurrency control. Not setting the `etag`in a + // `SetOrgPolicy` request will result in an unconditional write of the + // `Policy`. + bytes etag = 3; + + // The time stamp the `Policy` was previously updated. This is set by the + // server, not specified by the caller, and represents the last time a call to + // `SetOrgPolicy` was made for that `Policy`. Any value set by the client will + // be ignored. + google.protobuf.Timestamp update_time = 4; + + // The field to populate is based on the `constraint_type` value in the + // `Constraint`. + // `list_constraint` => `list_policy` + // `boolean_constraint` => `boolean_policy` + // + // A `restore_default` message may be used with any `Constraint` type. + // + // Providing a *_policy that is incompatible with the `constraint_type` will + // result in an `invalid_argument` error. + // + // Attempting to set a `Policy` with a `policy_type` not set will result in an + // `invalid_argument` error. + oneof policy_type { + // List of values either allowed or disallowed. + ListPolicy list_policy = 5; + + // For boolean `Constraints`, whether to enforce the `Constraint` or not. + BooleanPolicy boolean_policy = 6; + + // Restores the default behavior of the constraint; independent of + // `Constraint` type. + RestoreDefault restore_default = 7; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/inventory.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/inventory.proto new file mode 100644 index 00000000000..96e0b23f880 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/inventory.proto @@ -0,0 +1,384 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "Inventories"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS Config Inventory is a service for collecting and reporting operating +// system and package information on VM instances. + +// This API resource represents the available inventory data for a +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// You can use this API resource to determine the inventory data of your VM. +// +// For more information, see [Information provided by OS inventory +// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). +message Inventory { + option (google.api.resource) = { + type: "osconfig.googleapis.com/Inventory" + pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory" + }; + + // Operating system information for the VM. + message OsInfo { + // The VM hostname. + string hostname = 9; + + // The operating system long name. + // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019 + // Datacenter'. + string long_name = 2; + + // The operating system short name. + // For example, 'windows' or 'debian'. + string short_name = 3; + + // The version of the operating system. + string version = 4; + + // The system architecture of the operating system. + string architecture = 5; + + // The kernel version of the operating system. + string kernel_version = 6; + + // The kernel release of the operating system. + string kernel_release = 7; + + // The current version of the OS Config agent running on the VM. + string osconfig_agent_version = 8; + } + + // A single piece of inventory on a VM. + message Item { + // The origin of a specific inventory item. + enum OriginType { + // Invalid. An origin type must be specified. + ORIGIN_TYPE_UNSPECIFIED = 0; + + // This inventory item was discovered as the result of the agent + // reporting inventory via the reporting API. + INVENTORY_REPORT = 1; + } + + // The different types of inventory that are tracked on a VM. + enum Type { + // Invalid. An type must be specified. + TYPE_UNSPECIFIED = 0; + + // This represents a package that is installed on the VM. + INSTALLED_PACKAGE = 1; + + // This represents an update that is available for a package. + AVAILABLE_PACKAGE = 2; + } + + // Identifier for this item, unique across items for this VM. + string id = 1; + + // The origin of this inventory item. + OriginType origin_type = 2; + + // When this inventory item was first detected. + google.protobuf.Timestamp create_time = 8; + + // When this inventory item was last modified. + google.protobuf.Timestamp update_time = 9; + + // The specific type of inventory, correlating to its specific details. + Type type = 5; + + // Specific details of this inventory item based on its type. + oneof details { + // Software package present on the VM instance. + SoftwarePackage installed_package = 6; + + // Software package available to be installed on the VM instance. + SoftwarePackage available_package = 7; + } + } + + // Software package information of the operating system. + message SoftwarePackage { + // Information about the different types of software packages. + oneof details { + // Yum package info. + // For details about the yum package manager, see + // https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum. + VersionedPackage yum_package = 1; + + // Details of an APT package. + // For details about the apt package manager, see + // https://wiki.debian.org/Apt. + VersionedPackage apt_package = 2; + + // Details of a Zypper package. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + VersionedPackage zypper_package = 3; + + // Details of a Googet package. + // For details about the googet package manager, see + // https://github.com/google/googet. + VersionedPackage googet_package = 4; + + // Details of a Zypper patch. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + ZypperPatch zypper_patch = 5; + + // Details of a Windows Update package. + // See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for + // information about Windows Update. + WindowsUpdatePackage wua_package = 6; + + // Details of a Windows Quick Fix engineering package. + // See + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + // for info in Windows Quick Fix Engineering. + WindowsQuickFixEngineeringPackage qfe_package = 7; + + // Details of a COS package. + VersionedPackage cos_package = 8; + + // Details of Windows Application. + WindowsApplication windows_application = 9; + } + } + + // Information related to the a standard versioned package. This includes + // package info for APT, Yum, Zypper, and Googet package managers. + message VersionedPackage { + // The name of the package. + string package_name = 4; + + // The system architecture this package is intended for. + string architecture = 2; + + // The version of the package. + string version = 3; + } + + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + + // Details related to a Windows Update package. + // Field data and names are taken from Windows Update API IUpdate Interface: + // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ + // Descriptive fields like title, and description are localized based on + // the locale of the VM being updated. + message WindowsUpdatePackage { + // Categories specified by the Windows Update. + message WindowsUpdateCategory { + // The identifier of the windows update category. + string id = 1; + + // The name of the windows update category. + string name = 2; + } + + // The localized title of the update package. + string title = 1; + + // The localized description of the update package. + string description = 2; + + // The categories that are associated with this update package. + repeated WindowsUpdateCategory categories = 3; + + // A collection of Microsoft Knowledge Base article IDs that are associated + // with the update package. + repeated string kb_article_ids = 4; + + // A hyperlink to the language-specific support information for the update. + string support_url = 11; + + // A collection of URLs that provide more information about the update + // package. + repeated string more_info_urls = 5; + + // Gets the identifier of an update package. Stays the same across + // revisions. + string update_id = 6; + + // The revision number of this update package. + int32 revision_number = 7; + + // The last published date of the update, in (UTC) date and time. + google.protobuf.Timestamp last_deployment_change_time = 10; + } + + // Information related to a Quick Fix Engineering package. + // Fields are taken from Windows QuickFixEngineering Interface and match + // the source names: + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + message WindowsQuickFixEngineeringPackage { + // A short textual description of the QFE update. + string caption = 1; + + // A textual description of the QFE update. + string description = 2; + + // Unique identifier associated with a particular QFE update. + string hot_fix_id = 3; + + // Date that the QFE update was installed. Mapped from installed_on field. + google.protobuf.Timestamp install_time = 5; + } + + // Contains information about a Windows application that is retrieved from the + // Windows Registry. For more information about these fields, see: + // https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key + message WindowsApplication { + // The name of the application or product. + string display_name = 1; + + // The version of the product or application in string format. + string display_version = 2; + + // The name of the manufacturer for the product or application. + string publisher = 3; + + // The last time this product received service. The value of this property + // is replaced each time a patch is applied or removed from the product or + // the command-line option is used to repair the product. + google.type.Date install_date = 4; + + // The internet address for technical support. + string help_link = 5; + } + + // Output only. The `Inventory` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Base level operating system information for the VM. + OsInfo os_info = 1; + + // Inventory items related to the VM keyed by an opaque unique identifier for + // each inventory item. The identifier is unique to each distinct and + // addressable inventory item and will change, when there is a new package + // version. + map items = 2; + + // Output only. Timestamp of the last reported inventory for the VM. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting inventory data for the specified VM. +message GetInventoryRequest { + // Required. API resource name for inventory resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/inventory` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/Inventory" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; +} + +// A request message for listing inventory data for all VMs in the specified +// location. +message ListInventoriesRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; + + // The maximum number of results to return. + int32 page_size = 3; + + // A pagination token returned from a previous call to + // `ListInventories` that indicates where this listing + // should continue from. + string page_token = 4; + + // If provided, this field specifies the criteria that must be met by a + // `Inventory` API resource to be included in the response. + string filter = 5; +} + +// A response message for listing inventory data for all VMs in a specified +// location. +message ListInventoriesResponse { + // List of inventory objects. + repeated Inventory inventories = 1; + + // The pagination token to retrieve the next page of inventory objects. + string next_page_token = 2; +} + +// The view for inventory objects. +enum InventoryView { + // The default value. + // The API defaults to the BASIC view. + INVENTORY_VIEW_UNSPECIFIED = 0; + + // Returns the basic inventory information that includes `os_info`. + BASIC = 1; + + // Returns all fields. + FULL = 2; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy.proto new file mode 100644 index 00000000000..b67eb9c6f99 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy.proto @@ -0,0 +1,548 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// An OS policy defines the desired state configuration for a VM. +message OSPolicy { + // Policy mode + enum Mode { + // Invalid mode + MODE_UNSPECIFIED = 0; + + // This mode checks if the configuration resources in the policy are in + // their desired state. No actions are performed if they are not in the + // desired state. This mode is used for reporting purposes. + VALIDATION = 1; + + // This mode checks if the configuration resources in the policy are in + // their desired state, and if not, enforces the desired state. + ENFORCEMENT = 2; + } + + // Filtering criteria to select VMs based on inventory details. + message InventoryFilter { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // An OS policy resource is used to define the desired state configuration + // and provides a specific functionality like installing/removing packages, + // executing a script etc. + // + // The system ensures that resources are always in their desired state by + // taking necessary actions if they have drifted from their desired state. + message Resource { + // A remote or local file. + message File { + // Specifies a file available via some URI. + message Remote { + // Required. URI from which to fetch the object. It should contain both + // the protocol and path following the format `{protocol}://{location}`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // SHA256 checksum of the remote file. + string sha256_checksum = 2; + } + + // Specifies a file available as a Cloud Storage Object. + message Gcs { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Generation number of the Cloud Storage object. + int64 generation = 3; + } + + // A specific type of file. + oneof type { + // A generic remote file. + Remote remote = 1; + + // A Cloud Storage object. + Gcs gcs = 2; + + // A local path within the VM to use. + string local_path = 3; + } + + // Defaults to false. When false, files are subject to validations + // based on the file type: + // + // Remote: A checksum must be specified. + // Cloud Storage: An object generation number must be specified. + bool allow_insecure = 4; + } + + // A resource that manages a system package. + message PackageResource { + // The desired state that the OS Config agent maintains on the VM. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure that the package is installed. + INSTALLED = 1; + + // The agent ensures that the package is not installed and + // uninstalls it if detected. + REMOVED = 2; + } + + // A deb package file. dpkg packages only support INSTALLED state. + message Deb { + // Required. A deb package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `dpkg -i package` + // - install when true: `apt-get update && apt-get -y install + // package.deb` + bool pull_deps = 2; + } + + // A package managed by APT. + // - install: `apt-get update && apt-get -y install [name]` + // - remove: `apt-get -y remove [name]` + message APT { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An RPM package file. RPM packages only support INSTALLED state. + message RPM { + // Required. An rpm package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `rpm --upgrade --replacepkgs package.rpm` + // - install when true: `yum -y install package.rpm` or + // `zypper -y install package.rpm` + bool pull_deps = 2; + } + + // A package managed by YUM. + // - install: `yum -y install package` + // - remove: `yum -y remove package` + message YUM { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by Zypper. + // - install: `zypper -y install package` + // - remove: `zypper -y rm package` + message Zypper { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by GooGet. + // - install: `googet -noconfirm install package` + // - remove: `googet -noconfirm remove package` + message GooGet { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An MSI package. MSI packages only support INSTALLED state. + message MSI { + // Required. The MSI package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Additional properties to use during installation. + // This should be in the format of Property=Setting. + // Appended to the defaults of `ACTION=INSTALL + // REBOOT=ReallySuppress`. + repeated string properties = 2; + } + + // Required. The desired state the agent should maintain for this package. + DesiredState desired_state = 1 [(google.api.field_behavior) = REQUIRED]; + + // A system package. + oneof system_package { + // A package managed by Apt. + APT apt = 2; + + // A deb package file. + Deb deb = 3; + + // A package managed by YUM. + YUM yum = 4; + + // A package managed by Zypper. + Zypper zypper = 5; + + // An rpm package file. + RPM rpm = 6; + + // A package managed by GooGet. + GooGet googet = 7; + + // An MSI package. + MSI msi = 8; + } + } + + // A resource that manages a package repository. + message RepositoryResource { + // Represents a single apt package repository. These will be added to + // a repo file that will be managed at + // `/etc/apt/sources.list.d/google_osconfig.list`. + message AptRepository { + // Type of archive. + enum ArchiveType { + // Unspecified is invalid. + ARCHIVE_TYPE_UNSPECIFIED = 0; + + // Deb indicates that the archive contains binary files. + DEB = 1; + + // Deb-src indicates that the archive contains source files. + DEB_SRC = 2; + } + + // Required. Type of archive files in this repository. + ArchiveType archive_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URI for this repository. + string uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Distribution of this repository. + string distribution = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of components for this repository. Must contain at + // least one item. + repeated string components = 4 [(google.api.field_behavior) = REQUIRED]; + + // URI of the key file for this repository. The agent maintains a + // keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg`. + string gpg_key = 5; + } + + // Represents a single yum package repository. These are added to a + // repo file that is managed at + // `/etc/yum.repos.d/google_osconfig.repo`. + message YumRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the yum config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for resource conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a single zypper package repository. These are added to a + // repo file that is managed at + // `/etc/zypp/repos.d/google_osconfig.repo`. + message ZypperRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the zypper config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for GuestPolicy conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a Goo package repository. These are added to a repo file + // that is managed at + // `C:/ProgramData/GooGet/repos/google_osconfig.repo`. + message GooRepository { + // Required. The name of the repository. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The url of the repository. + string url = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A specific type of repository. + oneof repository { + // An Apt Repository. + AptRepository apt = 1; + + // A Yum Repository. + YumRepository yum = 2; + + // A Zypper Repository. + ZypperRepository zypper = 3; + + // A Goo Repository. + GooRepository goo = 4; + } + } + + // A resource that allows executing scripts on the VM. + // + // The `ExecResource` has 2 stages: `validate` and `enforce` and both stages + // accept a script as an argument to execute. + // + // When the `ExecResource` is applied by the agent, it first executes the + // script in the `validate` stage. The `validate` stage can signal that the + // `ExecResource` is already in the desired state by returning an exit code + // of `100`. If the `ExecResource` is not in the desired state, it should + // return an exit code of `101`. Any other exit code returned by this stage + // is considered an error. + // + // If the `ExecResource` is not in the desired state based on the exit code + // from the `validate` stage, the agent proceeds to execute the script from + // the `enforce` stage. If the `ExecResource` is already in the desired + // state, the `enforce` stage will not be run. + // Similar to `validate` stage, the `enforce` stage should return an exit + // code of `100` to indicate that the resource in now in its desired state. + // Any other exit code is considered an error. + // + // NOTE: An exit code of `100` was chosen over `0` (and `101` vs `1`) to + // have an explicit indicator of `in desired state`, `not in desired state` + // and errors. Because, for example, Powershell will always return an exit + // code of `0` unless an `exit` statement is provided in the script. So, for + // reasons of consistency and being explicit, exit codes `100` and `101` + // were chosen. + message ExecResource { + // A file or script to execute. + message Exec { + // The interpreter to use. + enum Interpreter { + // Invalid value, the request will return validation error. + INTERPRETER_UNSPECIFIED = 0; + + // If an interpreter is not specified, the + // source is executed directly. This execution, without an + // interpreter, only succeeds for executables and scripts that have shebang lines. + NONE = 1; + + // Indicates that the script runs with `/bin/sh` on Linux and + // `cmd.exe` on Windows. + SHELL = 2; + + // Indicates that the script runs with PowerShell. + POWERSHELL = 3; + } + + // What to execute. + oneof source { + // A remote or local file. + File file = 1; + + // An inline script. + // The size of the script is limited to 1024 characters. + string script = 2; + } + + // Optional arguments to pass to the source during execution. + repeated string args = 3; + + // Required. The script interpreter to use. + Interpreter interpreter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Only recorded for enforce Exec. + // Path to an output file (that is created by this Exec) whose + // content will be recorded in OSPolicyResourceCompliance after a + // successful run. Absence or failure to read this file will result in + // this ExecResource being non-compliant. Output file size is limited to + // 100K bytes. + string output_file_path = 5; + } + + // Required. What to run to validate this resource is in the desired + // state. An exit code of 100 indicates "in desired state", and exit code + // of 101 indicates "not in desired state". Any other exit code indicates + // a failure running validate. + Exec validate = 1 [(google.api.field_behavior) = REQUIRED]; + + // What to run to bring this resource into the desired state. + // An exit code of 100 indicates "success", any other exit code indicates + // a failure running enforce. + Exec enforce = 2; + } + + // A resource that manages the state of a file. + message FileResource { + // Desired state of the file. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure file at path is present. + PRESENT = 1; + + // Ensure file at path is absent. + ABSENT = 2; + + // Ensure the contents of the file at path matches. If the file does + // not exist it will be created. + CONTENTS_MATCH = 3; + } + + // The source for the contents of the file. + oneof source { + // A remote or local source. + File file = 1; + + // A a file with this content. + // The size of the content is limited to 1024 characters. + string content = 2; + } + + // Required. The absolute path of the file within the VM. + string path = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Desired state of the file. + DesiredState state = 4 [(google.api.field_behavior) = REQUIRED]; + + // Consists of three octal digits which represent, in + // order, the permissions of the owner, group, and other users for the + // file (similarly to the numeric mode used in the linux chmod + // utility). Each digit represents a three bit number with the 4 bit + // corresponding to the read permissions, the 2 bit corresponds to the + // write bit, and the one bit corresponds to the execute permission. + // Default behavior is 755. + // + // Below are some examples of permissions and their associated values: + // read, write, and execute: 7 + // read and execute: 5 + // read and write: 6 + // read only: 4 + string permissions = 5; + } + + // Required. The id of the resource with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the OS policy. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Resource type. + oneof resource_type { + // Package resource + PackageResource pkg = 2; + + // Package repository resource + RepositoryResource repository = 3; + + // Exec resource + ExecResource exec = 4; + + // File resource + FileResource file = 5; + } + } + + // Resource groups provide a mechanism to group OS policy resources. + // + // Resource groups enable OS policy authors to create a single OS policy + // to be applied to VMs running different operating Systems. + // + // When the OS policy is applied to a target VM, the appropriate resource + // group within the OS policy is selected based on the `OSFilter` specified + // within the resource group. + message ResourceGroup { + // List of inventory filters for the resource group. + // + // The resources in this resource group are applied to the target VM if it + // satisfies at least one of the following inventory filters. + // + // For example, to apply this resource group to VMs running either `RHEL` or + // `CentOS` operating systems, specify 2 items for the list with following + // values: + // inventory_filters[0].os_short_name='rhel' and + // inventory_filters[1].os_short_name='centos' + // + // If the list is empty, this resource group will be applied to the target + // VM unconditionally. + repeated InventoryFilter inventory_filters = 1; + + // Required. List of resources configured for this resource group. + // The resources are executed in the exact order specified here. + repeated Resource resources = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The id of the OS policy with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the assignment. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Policy description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. Policy mode + Mode mode = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of resource groups for the policy. + // For a particular VM, resource groups are evaluated in the order specified + // and the first resource group that is applicable is selected and the rest + // are ignored. + // + // If none of the resource groups are applicable for a VM, the VM is + // considered to be non-compliant w.r.t this policy. This behavior can be + // toggled by the flag `allow_no_resource_group_match` + repeated ResourceGroup resource_groups = 4 + [(google.api.field_behavior) = REQUIRED]; + + // This flag determines the OS policy compliance status when none of the + // resource groups within the policy are applicable for a VM. Set this value + // to `true` if the policy needs to be reported as compliant even if the + // policy has nothing to validate or enforce. + bool allow_no_resource_group_match = 5; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto new file mode 100644 index 00000000000..1a290ee5eca --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto @@ -0,0 +1,296 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OSPolicyAssignmentReportsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}" +}; + +// Get a report of the OS policy assignment for a VM instance. +message GetOSPolicyAssignmentReportRequest { + // Required. API resource name for OS policy assignment report. + // + // Format: + // `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + // For `{assignment_id}`, the OSPolicyAssignment id must be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + } + ]; +} + +// List the OS policy assignment reports for VM instances. +message ListOSPolicyAssignmentReportsRequest { + // Required. The parent resource name. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + // provided. If '-' is provided, the response will include + // OSPolicyAssignmentReports for all instances in the project/location. + // For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + // is provided, the response will include OSPolicyAssignmentReports for all + // OSPolicyAssignments in the project/location. + // Either {instance} or {assignment} must be `-`. + // + // For example: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + // returns all reports for the instance + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + // returns all the reports for the given assignment across all instances. + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + // returns all the reports for all assignments across all instances. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // If provided, this field specifies the criteria that must be met by the + // `OSPolicyAssignmentReport` API resource that is included in the response. + string filter = 3; + + // A pagination token returned from a previous call to the + // `ListOSPolicyAssignmentReports` method that indicates where this listing + // should continue from. + string page_token = 4; +} + +// A response message for listing OS Policy assignment reports including the +// page of results and page token. +message ListOSPolicyAssignmentReportsResponse { + // List of OS policy assignment reports. + repeated OSPolicyAssignmentReport os_policy_assignment_reports = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // report objects. + string next_page_token = 2; +} + +// A report of the OS policy assignment status for a given instance. +message OSPolicyAssignmentReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report" + }; + + // Compliance data for an OS policy + message OSPolicyCompliance { + // Possible compliance states for an os policy. + enum ComplianceState { + // The policy is in an unknown compliance state. + // + // Refer to the field `compliance_state_reason` to learn the exact reason + // for the policy to be in this compliance state. + UNKNOWN = 0; + + // Policy is compliant. + // + // The policy is compliant if all the underlying resources are also + // compliant. + COMPLIANT = 1; + + // Policy is non-compliant. + // + // The policy is non-compliant if one or more underlying resources are + // non-compliant. + NON_COMPLIANT = 2; + } + + // Compliance data for an OS policy resource. + message OSPolicyResourceCompliance { + // Step performed by the OS Config agent for configuring an + // `OSPolicy` resource to its desired state. + message OSPolicyResourceConfigStep { + // Supported configuration step types + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Checks for resource conflicts such as schema errors. + VALIDATION = 1; + + // Checks the current status of the desired state for a resource. + DESIRED_STATE_CHECK = 2; + + // Enforces the desired state for a resource that is not in desired + // state. + DESIRED_STATE_ENFORCEMENT = 3; + + // Re-checks the status of the desired state. This check is done + // for a resource after the enforcement of all OS policies. + // + // This step is used to determine the final desired state status for + // the resource. It accounts for any resources that might have drifted + // from their desired state due to side effects from executing other + // resources. + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4; + } + + // Configuration step type. + Type type = 1; + + // An error message recorded during the execution of this step. + // Only populated if errors were encountered during this step execution. + string error_message = 2; + } + + // Possible compliance states for a resource. + enum ComplianceState { + // The resource is in an unknown compliance state. + // + // To get more details about why the policy is in this state, review + // the output of the `compliance_state_reason` field. + UNKNOWN = 0; + + // Resource is compliant. + COMPLIANT = 1; + + // Resource is non-compliant. + NON_COMPLIANT = 2; + } + + // ExecResource specific output. + message ExecResourceOutput { + // Output from enforcement phase output file (if run). + // Output size is limited to 100K bytes. + bytes enforcement_output = 2; + } + + // The ID of the OS policy resource. + string os_policy_resource_id = 1; + + // Ordered list of configuration completed by the agent for the OS policy + // resource. + repeated OSPolicyResourceConfigStep config_steps = 2; + + // The compliance state of the resource. + ComplianceState compliance_state = 3; + + // A reason for the resource to be in the given compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // The following values are supported when `compliance_state == UNKNOWN` + // + // * `execution-errors`: Errors were encountered by the agent while + // executing the resource and the compliance state couldn't be + // determined. + // * `execution-skipped-by-agent`: Resource execution was skipped by the + // agent because errors were encountered while executing prior resources + // in the OS policy. + // * `os-policy-execution-attempt-failed`: The execution of the OS policy + // containing this resource failed and the compliance state couldn't be + // determined. + string compliance_state_reason = 4; + + // Resource specific output. + oneof output { + // ExecResource specific output. + ExecResourceOutput exec_resource_output = 5; + } + } + + // The OS policy id + string os_policy_id = 1; + + // The compliance state of the OS policy. + ComplianceState compliance_state = 2; + + // The reason for the OS policy to be in an unknown compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // If populated, the field can contain one of the following values: + // + // * `vm-not-running`: The VM was not running. + // * `os-policies-not-supported-by-agent`: The version of the OS Config + // agent running on the VM does not support running OS policies. + // * `no-agent-detected`: The OS Config agent is not detected for the VM. + // * `resource-execution-errors`: The OS Config agent encountered errors + // while executing one or more resources in the policy. See + // `os_policy_resource_compliances` for details. + // * `task-timeout`: The task sent to the agent to apply the policy timed + // out. + // * `unexpected-agent-state`: The OS Config agent did not report the final + // status of the task that attempted to apply the policy. Instead, the agent + // unexpectedly started working on a different task. This mostly happens + // when the agent or VM unexpectedly restarts while applying OS policies. + // * `internal-service-errors`: Internal service errors were encountered + // while attempting to apply the policy. + string compliance_state_reason = 3; + + // Compliance data for each resource within the policy that is applied to + // the VM. + repeated OSPolicyResourceCompliance os_policy_resource_compliances = 4; + } + + // The `OSPolicyAssignmentReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/osPolicyAssignments/{os_policy_assignment_id}/report` + string name = 1; + + // The Compute Engine VM instance name. + string instance = 2; + + // Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` + // belongs to. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 3 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // Compliance data for each `OSPolicy` that is applied to the VM. + repeated OSPolicyCompliance os_policy_compliances = 4; + + // Timestamp for when the report was last generated. + google.protobuf.Timestamp update_time = 5; + + // Unique identifier of the last attempted run to apply the OS policies + // associated with this assignment on the VM. + // + // This ID is logged by the OS Config agent while applying the OS + // policies associated with this assignment on the VM. + // NOTE: If the service is unable to successfully connect to the agent for + // this run, then this id will not be available in the agent logs. + string last_run_id = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto new file mode 100644 index 00000000000..e1bfb7e1fb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto @@ -0,0 +1,386 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/os_policy.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyAssignmentsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS policy assignment is an API resource that is used to +// apply a set of OS policies to a dynamically targeted group of Compute Engine +// VM instances. +// +// An OS policy is used to define the desired state configuration for a +// Compute Engine VM instance through a set of configuration resources that +// provide capabilities such as installing or removing software packages, or +// executing a script. +// +// For more information, see [OS policy and OS policy +// assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies). +message OSPolicyAssignment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}" + }; + + // Message representing label set. + // * A label is a key value pair set for a VM. + // * A LabelSet is a set of labels. + // * Labels within a LabelSet are ANDed. In other words, a LabelSet is + // applicable for a VM only if it matches all the labels in the + // LabelSet. + // * Example: A LabelSet with 2 labels: `env=prod` and `type=webserver` will + // only be applicable for those VMs with both labels + // present. + message LabelSet { + // Labels are identified by key/value pairs in this map. + // A VM should contain all the key/value pairs specified in this + // map to be selected. + map labels = 1; + } + + // Filters to select target VMs for an assignment. + // + // If more than one filter criteria is specified below, a VM will be selected + // if and only if it satisfies all of them. + message InstanceFilter { + // VM inventory details. + message Inventory { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // Target all VMs in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // List of label sets used for VM inclusion. + // + // If the list has more than one `LabelSet`, the VM is included if any + // of the label sets are applicable for the VM. + repeated LabelSet inclusion_labels = 2; + + // List of label sets used for VM exclusion. + // + // If the list has more than one label set, the VM is excluded if any + // of the label sets are applicable for the VM. + repeated LabelSet exclusion_labels = 3; + + // List of inventories to select VMs. + // + // A VM is selected if its inventory data matches at least one of the + // following inventories. + repeated Inventory inventories = 4; + } + + // Message to configure the rollout at the zonal level for the OS policy + // assignment. + message Rollout { + // Required. The maximum number (or percentage) of VMs per zone to disrupt + // at any given moment. + FixedOrPercent disruption_budget = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. This determines the minimum duration of time to wait after the + // configuration changes are applied through the current rollout. A + // VM continues to count towards the `disruption_budget` at least + // until this duration of time has passed after configuration changes are + // applied. + google.protobuf.Duration min_wait_duration = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // OS policy assignment rollout state + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}` + // + // This field is ignored when you create an OS policy assignment. + string name = 1; + + // OS policy assignment description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. List of OS policies to be applied to the VMs. + repeated OSPolicy os_policies = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Filter to select VMs. + InstanceFilter instance_filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rollout to deploy the OS policy assignment. + // A rollout is triggered in the following situations: + // 1) OSPolicyAssignment is created. + // 2) OSPolicyAssignment is updated and the update contains changes to one of + // the following fields: + // - instance_filter + // - os_policies + // 3) OSPolicyAssignment is deleted. + Rollout rollout = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The assignment revision ID + // A new revision is committed whenever a rollout is triggered for a OS policy + // assignment + string revision_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp revision_create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The etag for this OS policy assignment. + // If this is provided on update, it must match the server's etag. + string etag = 8; + + // Output only. OS policy assignment rollout state + RolloutState rollout_state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision has been successfully rolled out + // in this zone and new VMs will be assigned OS policies from this revision. + // + // For a given OS policy assignment, there is only one revision with a value + // of `true` for this field. + bool baseline = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision deletes the OS policy assignment. + bool deleted = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that reconciliation is in progress for the revision. + // This value is `true` when the `rollout_state` is one of: + // * IN_PROGRESS + // * CANCELLING + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated unique id for the OS policy assignment + // resource. + string uid = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OS policy assignment operation metadata provided by OS policy assignment API +// methods that return long running operations. +message OSPolicyAssignmentOperationMetadata { + // The OS policy assignment API method. + enum APIMethod { + // Invalid value + API_METHOD_UNSPECIFIED = 0; + + // Create OS policy assignment API method + CREATE = 1; + + // Update OS policy assignment API method + UPDATE = 2; + + // Delete OS policy assignment API method + DELETE = 3; + } + + // State of the rollout + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Reference to the `OSPolicyAssignment` API resource. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 1 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // The OS policy assignment API method. + APIMethod api_method = 2; + + // State of the rollout + RolloutState rollout_state = 3; + + // Rollout start time + google.protobuf.Timestamp rollout_start_time = 4; + + // Rollout update time + google.protobuf.Timestamp rollout_update_time = 5; +} + +// A request message to create an OS policy assignment +message CreateOSPolicyAssignmentRequest { + // Required. The parent resource name in the form: + // projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The OS policy assignment to be created. + OSPolicyAssignment os_policy_assignment = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The logical name of the OS policy assignment in the project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string os_policy_assignment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message to update an OS policy assignment +message UpdateOSPolicyAssignmentRequest { + // Required. The updated OS policy assignment. + OSPolicyAssignment os_policy_assignment = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the assignment should be + // updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message to get an OS policy assignment +message GetOSPolicyAssignmentRequest { + // Required. The resource name of OS policy assignment. + // + // Format: + // `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} + +// A request message to list OS policy assignments for a parent resource +message ListOSPolicyAssignmentsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of assignments to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignments` that indicates where this listing should continue + // from. + string page_token = 3; +} + +// A response message for listing all assignments under given parent. +message ListOSPolicyAssignmentsResponse { + // The list of assignments + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignments. + string next_page_token = 2; +} + +// A request message to list revisions for a OS policy assignment +message ListOSPolicyAssignmentRevisionsRequest { + // Required. The name of the OS policy assignment to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; + + // The maximum number of revisions to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignmentRevisions` that indicates where this listing should + // continue from. + string page_token = 3; +} + +// A response message for listing all revisions for a OS policy assignment. +message ListOSPolicyAssignmentRevisionsResponse { + // The OS policy assignment revisions + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // revisions. + string next_page_token = 2; +} + +// A request message for deleting a OS policy assignment. +message DeleteOSPolicyAssignmentRequest { + // Required. The name of the OS policy assignment to be deleted + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_common.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_common.proto new file mode 100644 index 00000000000..1a6491cdd07 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_common.proto @@ -0,0 +1,38 @@ +// Copyright 2024 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.osconfig.v1; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "Common"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Message encapsulating a value that can be either absolute ("fixed") or +// relative ("percent") to a value. +message FixedOrPercent { + // Type of the value. + oneof mode { + // Specifies a fixed value. + int32 fixed = 1; + + // Specifies the relative value defined as a percentage, which will be + // multiplied by a reference value. + int32 percent = 2; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_service.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_service.proto new file mode 100644 index 00000000000..e4a5f2c5a83 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -0,0 +1,158 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_deployments.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "OsConfigProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/zones/{zone}/instances/{instance}" + pattern: "projects/{project}/locations/{location}/instances/{instance}" +}; + +// OS Config API +// +// The OS Config service is a server-side component that you can use to +// manage package installations and patch jobs for virtual machine instances. +service OsConfigService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Patch VM instances by creating and running a patch job. + rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchJobs:execute" + body: "*" + }; + } + + // Get the patch job. This can be used to track the progress of an + // ongoing patch job or review the details of completed jobs. + rpc GetPatchJob(GetPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancel a patch job. The patch job must be active. Canceled patch jobs + // cannot be restarted. + rpc CancelPatchJob(CancelPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchJobs/*}:cancel" + body: "*" + }; + } + + // Get a list of patch jobs. + rpc ListPatchJobs(ListPatchJobsRequest) returns (ListPatchJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Get a list of instance details for a given patch job. + rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) + returns (ListPatchJobInstanceDetailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/patchJobs/*}/instanceDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // Create an OS Config patch deployment. + rpc CreatePatchDeployment(CreatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchDeployments" + body: "patch_deployment" + }; + option (google.api.method_signature) = + "parent,patch_deployment,patch_deployment_id"; + } + + // Get an OS Config patch deployment. + rpc GetPatchDeployment(GetPatchDeploymentRequest) returns (PatchDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get a page of OS Config patch deployments. + rpc ListPatchDeployments(ListPatchDeploymentsRequest) + returns (ListPatchDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete an OS Config patch deployment. + rpc DeletePatchDeployment(DeletePatchDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update an OS Config patch deployment. + rpc UpdatePatchDeployment(UpdatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + patch: "/v1/{patch_deployment.name=projects/*/patchDeployments/*}" + body: "patch_deployment" + }; + option (google.api.method_signature) = "patch_deployment,update_mask"; + } + + // Change state of patch deployment to "PAUSED". + // Patch deployment in paused state doesn't generate patch jobs. + rpc PausePatchDeployment(PausePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Change state of patch deployment back to "ACTIVE". + // Patch deployment in active state continues to generate patch jobs. + rpc ResumePatchDeployment(ResumePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto new file mode 100644 index 00000000000..8a868362f5e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -0,0 +1,202 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/cloud/osconfig/v1/os_policy_assignment_reports.proto"; +import "google/cloud/osconfig/v1/os_policy_assignments.proto"; +import "google/cloud/osconfig/v1/vulnerability.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsConfigZonalServiceProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Zonal OS Config API +// +// The OS Config service is the server-side component that allows users to +// manage package installations and patch jobs for Compute Engine VM instances. +service OsConfigZonalService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create an OS policy assignment. + // + // This method also creates the first revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = + "parent,os_policy_assignment,os_policy_assignment_id"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Update an existing OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc UpdateOSPolicyAssignment(UpdateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = "os_policy_assignment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Retrieve an existing OS policy assignment. + // + // This method always returns the latest revision. In order to retrieve a + // previous revision of the assignment, also provide the revision ID in the + // `name` parameter. + rpc GetOSPolicyAssignment(GetOSPolicyAssignmentRequest) + returns (OSPolicyAssignment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List the OS policy assignments under the parent resource. + // + // For each OS policy assignment, the latest revision is returned. + rpc ListOSPolicyAssignments(ListOSPolicyAssignmentsRequest) + returns (ListOSPolicyAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + }; + option (google.api.method_signature) = "parent"; + } + + // List the OS policy assignment revisions for a given OS policy assignment. + rpc ListOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest) + returns (ListOSPolicyAssignmentRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" + }; + option (google.api.method_signature) = "name"; + } + + // Delete the OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // If the LRO completes and is not cancelled, all revisions associated with + // the OS policy assignment are deleted. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Get the OS policy asssignment report for the specified Compute Engine VM + // instance. + rpc GetOSPolicyAssignmentReport(GetOSPolicyAssignmentReportRequest) + returns (OSPolicyAssignmentReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" + }; + option (google.api.method_signature) = "name"; + } + + // List OS policy asssignment reports for all Compute Engine VM instances in + // the specified zone. + rpc ListOSPolicyAssignmentReports(ListOSPolicyAssignmentReportsRequest) + returns (ListOSPolicyAssignmentReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" + }; + option (google.api.method_signature) = "parent"; + } + + // Get inventory data for the specified VM instance. If the VM has no + // associated inventory, the message `NOT_FOUND` is returned. + rpc GetInventory(GetInventoryRequest) returns (Inventory) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/inventory}" + }; + option (google.api.method_signature) = "name"; + } + + // List inventory data for all VM instances in the specified zone. + rpc ListInventories(ListInventoriesRequest) + returns (ListInventoriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the vulnerability report for the specified VM instance. Only VMs with + // inventory data have vulnerability reports associated with them. + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) + returns (VulnerabilityReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + }; + option (google.api.method_signature) = "name"; + } + + // List vulnerability reports for all VM instances in the specified zone. + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) + returns (ListVulnerabilityReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/patch_deployments.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/patch_deployments.proto new file mode 100644 index 00000000000..4df0e371048 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -0,0 +1,339 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/datetime.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "PatchDeployments"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Patch deployments are configurations that individual patch jobs use to +// complete a patch. These configurations include instance filter, package +// repository settings, and a schedule. For more information about creating and +// managing patch deployments, see [Scheduling patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/schedule-patch-jobs). +message PatchDeployment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchDeployment" + pattern: "projects/{project}/patchDeployments/{patch_deployment}" + }; + + // Represents state of patch peployment. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // Active value means that patch deployment generates Patch Jobs. + ACTIVE = 1; + + // Paused value means that patch deployment does not generate + // Patch jobs. Requires user action to move in and out from this state. + PAUSED = 2; + } + + // Unique name for the patch deployment resource in a project. The patch + // deployment name is in the form: + // `projects/{project_id}/patchDeployments/{patch_deployment_id}`. + // This field is ignored when you create a new patch deployment. + string name = 1; + + // Optional. Description of the patch deployment. Length of the description is + // limited to 1024 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. VM instances to patch. + PatchInstanceFilter instance_filter = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Patch configuration that is applied. + PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Duration of the patch. After the duration ends, the patch times + // out. + google.protobuf.Duration duration = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Schedule for the patch. + oneof schedule { + // Required. Schedule a one-time execution. + OneTimeSchedule one_time_schedule = 6 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule recurring executions. + RecurringSchedule recurring_schedule = 7 + [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. Time the patch deployment was created. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time the patch deployment was last updated. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time a patch job was started by this deployment. + // Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text + // format. + google.protobuf.Timestamp last_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Rollout strategy of the patch job. + PatchRollout rollout = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the patch deployment. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Sets the time for a one time patch deployment. Timestamp is in +// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. +message OneTimeSchedule { + // Required. The desired patch job execution time. + google.protobuf.Timestamp execute_time = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Sets the time for recurring patch deployments. +message RecurringSchedule { + // Specifies the frequency of the recurring patch deployments. + enum Frequency { + // Invalid. A frequency must be specified. + FREQUENCY_UNSPECIFIED = 0; + + // Indicates that the frequency of recurrence should be expressed in terms + // of weeks. + WEEKLY = 1; + + // Indicates that the frequency of recurrence should be expressed in terms + // of months. + MONTHLY = 2; + + // Indicates that the frequency of recurrence should be expressed in terms + // of days. + DAILY = 3; + } + + // Required. Defines the time zone that `time_of_day` is relative to. + // The rules for daylight saving time are determined by the chosen time zone. + google.type.TimeZone time_zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The time that the recurring schedule becomes effective. + // Defaults to `create_time` of the patch deployment. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end time at which a recurring patch deployment schedule is no + // longer active. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Time of the day to run a recurring deployment. + google.type.TimeOfDay time_of_day = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The frequency unit of this recurring schedule. + Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for this recurring schedule. + // Configurations must match frequency. + oneof schedule_config { + // Required. Schedule with weekly executions. + WeeklySchedule weekly = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule with monthly executions. + MonthlySchedule monthly = 7 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The time the last patch job ran successfully. + google.protobuf.Timestamp last_execute_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the next patch job is scheduled to run. + google.protobuf.Timestamp next_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a weekly schedule. +message WeeklySchedule { + // Required. Day of the week. + google.type.DayOfWeek day_of_week = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a monthly schedule. An example of a valid monthly schedule is +// "on the third Tuesday of the month" or "on the 15th of the month". +message MonthlySchedule { + // One day in a month. + oneof day_of_month { + // Required. Week day in a month. + WeekDayOfMonth week_day_of_month = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. One day of the month. 1-31 indicates the 1st to the 31st day. + // -1 indicates the last day of the month. Months without the target day + // will be skipped. For example, a schedule to run "every month on the 31st" + // will not run in February, April, June, etc. + int32 month_day = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Represents one week day in a month. An example is "the 4th Sunday". +message WeekDayOfMonth { + // Required. Week number in a month. 1-4 indicates the 1st to 4th week of the + // month. -1 indicates the last week of the month. + int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Represents the number of days before or after the given week day + // of month that the patch deployment is scheduled for. For example if + // `week_ordinal` and `day_of_week` values point to the second day of the + // month and this `day_offset` value is set to `3`, the patch deployment takes + // place three days after the second Tuesday of the month. If this value is + // negative, for example -5, the patches are deployed five days before before + // the second Tuesday of the month. Allowed values are in range [-30, 30]. + int32 day_offset = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for creating a patch deployment. +message CreatePatchDeploymentRequest { + // Required. The project to apply this patch deployment to in the form + // `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. A name for the patch deployment in the project. When creating a + // name the following rules apply: + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string patch_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The patch deployment to create. + PatchDeployment patch_deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for retrieving a patch deployment. +message GetPatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for listing patch deployments. +message ListPatchDeploymentsRequest { + // Required. The resource name of the parent in the form `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of patch deployments to return. Default is + // 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to + // ListPatchDeployments that indicates where this listing should continue + // from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for listing patch deployments. +message ListPatchDeploymentsResponse { + // The list of patch deployments. + repeated PatchDeployment patch_deployments = 1; + + // A pagination token that can be used to get the next page of patch + // deployments. + string next_page_token = 2; +} + +// A request message for deleting a patch deployment. +message DeletePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for updating a patch deployment. +message UpdatePatchDeploymentRequest { + // Required. The patch deployment to Update. + PatchDeployment patch_deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the patch deployment + // should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for pausing a patch deployment. +message PausePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for resuming a patch deployment. +message ResumePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/patch_jobs.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/patch_jobs.proto new file mode 100644 index 00000000000..ee3df87406f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/patch_jobs.proto @@ -0,0 +1,742 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "PatchJobs"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// A request message to initiate patching across Compute Engine +// instances. +message ExecutePatchJobRequest { + // Required. The project in which to run this patch in the form `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Required. Instances to patch, either explicitly or filtered by some + // criteria such as zone or labels. + PatchInstanceFilter instance_filter = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Patch configuration being applied. If omitted, instances are + // patched using the default configurations. + PatchConfig patch_config = 4; + + // Duration of the patch job. After the duration ends, the patch job + // times out. + google.protobuf.Duration duration = 5; + + // If this patch is a dry-run only, instances are contacted but + // will do nothing. + bool dry_run = 6; + + // Display name for this patch job. This does not have to be unique. + string display_name = 8; + + // Rollout strategy of the patch job. + PatchRollout rollout = 9; +} + +// Request to get an active or completed patch job. +message GetPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Request to list details for all instances that are part of a patch job. +message ListPatchJobInstanceDetailsRequest { + // Required. The parent for the instances are in the form of + // `projects/*/patchJobs/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; + + // The maximum number of instance details records to return. Default is 100. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // A filter expression that filters results listed in the response. This + // field supports filtering results by instance zone, name, state, or + // `failure_reason`. + string filter = 4; +} + +// A response message for listing the instances details for a patch job. +message ListPatchJobInstanceDetailsResponse { + // A list of instance status. + repeated PatchJobInstanceDetails patch_job_instance_details = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// Patch details for a VM instance. For more information about reviewing VM +// instance details, see +// [Listing all VM instance details for a specific patch +// job](https://cloud.google.com/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details). +message PatchJobInstanceDetails { + // The instance name in the form `projects/*/zones/*/instances/*` + string name = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + }]; + + // The unique identifier for the instance. This identifier is + // defined by the server. + string instance_system_id = 2; + + // Current state of instance patch. + Instance.PatchState state = 3; + + // If the patch fails, this field provides the reason. + string failure_reason = 4; + + // The number of times the agent that the agent attempts to apply the patch. + int64 attempt_count = 5; +} + +// A request message for listing patch jobs. +message ListPatchJobsRequest { + // Required. In the form of `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The maximum number of instance status to return. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by patch + // jobs to be included in the response. + // Currently, filtering is only available on the patch_deployment field. + string filter = 4; +} + +// A response message for listing patch jobs. +message ListPatchJobsResponse { + // The list of patch jobs. + repeated PatchJob patch_jobs = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// A high level representation of a patch job that is either in progress +// or has completed. +// +// Instance details are not included in the job. To paginate through instance +// details, use ListPatchJobInstanceDetails. +// +// For more information about patch jobs, see +// [Creating patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/create-patch-job). +message PatchJob { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchJob" + pattern: "projects/{project}/patchJobs/{patch_job}" + }; + + // Enumeration of the various states a patch job passes through as it + // executes. + enum State { + // State must be specified. + STATE_UNSPECIFIED = 0; + + // The patch job was successfully initiated. + STARTED = 1; + + // The patch job is looking up instances to run the patch on. + INSTANCE_LOOKUP = 2; + + // Instances are being patched. + PATCHING = 3; + + // Patch job completed successfully. + SUCCEEDED = 4; + + // Patch job completed but there were errors. + COMPLETED_WITH_ERRORS = 5; + + // The patch job was canceled. + CANCELED = 6; + + // The patch job timed out. + TIMED_OUT = 7; + } + + // A summary of the current patch state across all instances that this patch + // job affects. Contains counts of instances in different states. These states + // map to `InstancePatchState`. List patch job instance details to see the + // specific states of each instance. + message InstanceDetailsSummary { + // Number of instances pending patch job. + int64 pending_instance_count = 1; + + // Number of instances that are inactive. + int64 inactive_instance_count = 2; + + // Number of instances notified about patch job. + int64 notified_instance_count = 3; + + // Number of instances that have started. + int64 started_instance_count = 4; + + // Number of instances that are downloading patches. + int64 downloading_patches_instance_count = 5; + + // Number of instances that are applying patches. + int64 applying_patches_instance_count = 6; + + // Number of instances rebooting. + int64 rebooting_instance_count = 7; + + // Number of instances that have completed successfully. + int64 succeeded_instance_count = 8; + + // Number of instances that require reboot. + int64 succeeded_reboot_required_instance_count = 9; + + // Number of instances that failed. + int64 failed_instance_count = 10; + + // Number of instances that have acked and will start shortly. + int64 acked_instance_count = 11; + + // Number of instances that exceeded the time out while applying the patch. + int64 timed_out_instance_count = 12; + + // Number of instances that are running the pre-patch step. + int64 pre_patch_step_instance_count = 13; + + // Number of instances that are running the post-patch step. + int64 post_patch_step_instance_count = 14; + + // Number of instances that do not appear to be running the agent. Check to + // ensure that the agent is installed, running, and able to communicate with + // the service. + int64 no_agent_detected_instance_count = 15; + } + + // Unique identifier for this patch job in the form + // `projects/*/patchJobs/*` + string name = 1; + + // Display name for this patch job. This is not a unique identifier. + string display_name = 14; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Time this patch job was created. + google.protobuf.Timestamp create_time = 3; + + // Last time this patch job was updated. + google.protobuf.Timestamp update_time = 4; + + // The current state of the PatchJob. + State state = 5; + + // Instances to patch. + PatchInstanceFilter instance_filter = 13; + + // Patch configuration being applied. + PatchConfig patch_config = 7; + + // Duration of the patch job. After the duration ends, the + // patch job times out. + google.protobuf.Duration duration = 8; + + // Summary of instance details. + InstanceDetailsSummary instance_details_summary = 9; + + // If this patch job is a dry run, the agent reports that it has + // finished without running any updates on the VM instance. + bool dry_run = 10; + + // If this patch job failed, this message provides information about the + // failure. + string error_message = 11; + + // Reflects the overall progress of the patch job in the range of + // 0.0 being no progress to 100.0 being complete. + double percent_complete = 12; + + // Output only. Name of the patch deployment that created this patch job. + string patch_deployment = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; + + // Rollout strategy being applied. + PatchRollout rollout = 16; +} + +// Patch configuration specifications. Contains details on how to apply the +// patch(es) to a VM instance. +message PatchConfig { + // Post-patch reboot settings. + enum RebootConfig { + // The default behavior is DEFAULT. + REBOOT_CONFIG_UNSPECIFIED = 0; + + // The agent decides if a reboot is necessary by checking signals such as + // registry keys on Windows or `/var/run/reboot-required` on APT based + // systems. On RPM based systems, a set of core system package install times + // are compared with system boot time. + DEFAULT = 1; + + // Always reboot the machine after the update completes. + ALWAYS = 2; + + // Never reboot the machine after the update completes. + NEVER = 3; + } + + // Post-patch reboot settings. + RebootConfig reboot_config = 1; + + // Apt update settings. Use this setting to override the default `apt` patch + // rules. + AptSettings apt = 3; + + // Yum update settings. Use this setting to override the default `yum` patch + // rules. + YumSettings yum = 4; + + // Goo update settings. Use this setting to override the default `goo` patch + // rules. + GooSettings goo = 5; + + // Zypper update settings. Use this setting to override the default `zypper` + // patch rules. + ZypperSettings zypper = 6; + + // Windows update settings. Use this override the default windows patch rules. + WindowsUpdateSettings windows_update = 7; + + // The `ExecStep` to run before the patch update. + ExecStep pre_step = 8; + + // The `ExecStep` to run after the patch update. + ExecStep post_step = 9; + + // Allows the patch job to run on Managed instance groups (MIGs). + bool mig_instances_allowed = 10; +} + +// Namespace for instance state enums. +message Instance { + // Patch state of an instance. + enum PatchState { + // Unspecified. + PATCH_STATE_UNSPECIFIED = 0; + + // The instance is not yet notified. + PENDING = 1; + + // Instance is inactive and cannot be patched. + INACTIVE = 2; + + // The instance is notified that it should be patched. + NOTIFIED = 3; + + // The instance has started the patching process. + STARTED = 4; + + // The instance is downloading patches. + DOWNLOADING_PATCHES = 5; + + // The instance is applying patches. + APPLYING_PATCHES = 6; + + // The instance is rebooting. + REBOOTING = 7; + + // The instance has completed applying patches. + SUCCEEDED = 8; + + // The instance has completed applying patches but a reboot is required. + SUCCEEDED_REBOOT_REQUIRED = 9; + + // The instance has failed to apply the patch. + FAILED = 10; + + // The instance acked the notification and will start shortly. + ACKED = 11; + + // The instance exceeded the time out while applying the patch. + TIMED_OUT = 12; + + // The instance is running the pre-patch step. + RUNNING_PRE_PATCH_STEP = 13; + + // The instance is running the post-patch step. + RUNNING_POST_PATCH_STEP = 14; + + // The service could not detect the presence of the agent. Check to ensure + // that the agent is installed, running, and able to communicate with the + // service. + NO_AGENT_DETECTED = 15; + } +} + +// Message for canceling a patch job. +message CancelPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Apt patching is completed by executing `apt-get update && apt-get +// upgrade`. Additional options can be set to control how this is executed. +message AptSettings { + // Apt patch type. + enum Type { + // By default, upgrade will be performed. + TYPE_UNSPECIFIED = 0; + + // Runs `apt-get dist-upgrade`. + DIST = 1; + + // Runs `apt-get upgrade`. + UPGRADE = 2; + } + + // By changing the type to DIST, the patching is performed + // using `apt-get dist-upgrade` instead. + Type type = 1; + + // List of packages to exclude from update. These packages will be excluded + repeated string excludes = 2; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field cannot be specified with any other patch configuration + // fields. + repeated string exclusive_packages = 3; +} + +// Yum patching is performed by executing `yum update`. Additional options +// can be set to control how this is executed. +// +// Note that not all settings are supported on all platforms. +message YumSettings { + // Adds the `--security` flag to `yum update`. Not supported on + // all platforms. + bool security = 1; + + // Will cause patch to run `yum update-minimal` instead. + bool minimal = 2; + + // List of packages to exclude from update. These packages are excluded by + // using the yum `--exclude` flag. + repeated string excludes = 3; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field must not be specified with any other patch + // configuration fields. + repeated string exclusive_packages = 4; +} + +// Googet patching is performed by running `googet update`. +message GooSettings {} + +// Zypper patching is performed by running `zypper patch`. +// See also https://en.opensuse.org/SDB:Zypper_manual. +message ZypperSettings { + // Adds the `--with-optional` flag to `zypper patch`. + bool with_optional = 1; + + // Adds the `--with-update` flag, to `zypper patch`. + bool with_update = 2; + + // Install only patches with these categories. + // Common categories include security, recommended, and feature. + repeated string categories = 3; + + // Install only patches with these severities. + // Common severities include critical, important, moderate, and low. + repeated string severities = 4; + + // List of patches to exclude from update. + repeated string excludes = 5; + + // An exclusive list of patches to be updated. These are the only patches + // that will be installed using 'zypper patch patch:' command. + // This field must not be used with any other patch configuration fields. + repeated string exclusive_patches = 6; +} + +// Windows patching is performed using the Windows Update Agent. +message WindowsUpdateSettings { + // Microsoft Windows update classifications as defined in + // [1] + // https://support.microsoft.com/en-us/help/824684/description-of-the-standard-terminology-that-is-used-to-describe-micro + enum Classification { + // Invalid. If classifications are included, they must be specified. + CLASSIFICATION_UNSPECIFIED = 0; + + // "A widely released fix for a specific problem that addresses a critical, + // non-security-related bug." [1] + CRITICAL = 1; + + // "A widely released fix for a product-specific, security-related + // vulnerability. Security vulnerabilities are rated by their severity. The + // severity rating is indicated in the Microsoft security bulletin as + // critical, important, moderate, or low." [1] + SECURITY = 2; + + // "A widely released and frequent software update that contains additions + // to a product's definition database. Definition databases are often used + // to detect objects that have specific attributes, such as malicious code, + // phishing websites, or junk mail." [1] + DEFINITION = 3; + + // "Software that controls the input and output of a device." [1] + DRIVER = 4; + + // "New product functionality that is first distributed outside the context + // of a product release and that is typically included in the next full + // product release." [1] + FEATURE_PACK = 5; + + // "A tested, cumulative set of all hotfixes, security updates, critical + // updates, and updates. Additionally, service packs may contain additional + // fixes for problems that are found internally since the release of the + // product. Service packs my also contain a limited number of + // customer-requested design changes or features." [1] + SERVICE_PACK = 6; + + // "A utility or feature that helps complete a task or set of tasks." [1] + TOOL = 7; + + // "A tested, cumulative set of hotfixes, security updates, critical + // updates, and updates that are packaged together for easy deployment. A + // rollup generally targets a specific area, such as security, or a + // component of a product, such as Internet Information Services (IIS)." [1] + UPDATE_ROLLUP = 8; + + // "A widely released fix for a specific problem. An update addresses a + // noncritical, non-security-related bug." [1] + UPDATE = 9; + } + + // Only apply updates of these windows update classifications. If empty, all + // updates are applied. + repeated Classification classifications = 1; + + // List of KBs to exclude from update. + repeated string excludes = 2; + + // An exclusive list of kbs to be updated. These are the only patches + // that will be updated. This field must not be used with other + // patch configurations. + repeated string exclusive_patches = 3; +} + +// A step that runs an executable for a PatchJob. +message ExecStep { + // The ExecStepConfig for all Linux VMs targeted by the PatchJob. + ExecStepConfig linux_exec_step_config = 1; + + // The ExecStepConfig for all Windows VMs targeted by the PatchJob. + ExecStepConfig windows_exec_step_config = 2; +} + +// Common configurations for an ExecStep. +message ExecStepConfig { + // The interpreter used to execute the a file. + enum Interpreter { + // Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the + // interpreter will be parsed from the shebang line of the script if + // unspecified. + INTERPRETER_UNSPECIFIED = 0; + + // Indicates that the script is run with `/bin/sh` on Linux and `cmd` + // on Windows. + SHELL = 1; + + // Indicates that the file is run with PowerShell flags + // `-NonInteractive`, `-NoProfile`, and `-ExecutionPolicy Bypass`. + POWERSHELL = 2; + } + + // Location of the executable. + oneof executable { + // An absolute path to the executable on the VM. + string local_path = 1; + + // A Cloud Storage object containing the executable. + GcsObject gcs_object = 2; + } + + // Defaults to [0]. A list of possible return values that the + // execution can return to indicate a success. + repeated int32 allowed_success_codes = 3; + + // The script interpreter to use to run the script. If no interpreter is + // specified the script will be executed directly, which will likely + // only succeed for scripts with [shebang lines] + // (https://en.wikipedia.org/wiki/Shebang_\(Unix\)). + Interpreter interpreter = 4; +} + +// Cloud Storage object representation. +message GcsObject { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Generation number of the Cloud Storage object. This is used to + // ensure that the ExecStep specified by this PatchJob does not change. + int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A filter to target VM instances for patching. The targeted +// VMs must meet all criteria specified. So if both labels and zones are +// specified, the patch job targets only VMs with those labels and in those +// zones. +message PatchInstanceFilter { + // Targets a group of VM instances by using their [assigned + // labels](https://cloud.google.com/compute/docs/labeling-resources). Labels + // are key-value pairs. A `GroupLabel` is a combination of labels + // that is used to target VMs for a patch job. + // + // For example, a patch job can target VMs that have the following + // `GroupLabel`: `{"env":"test", "app":"web"}`. This means that the patch job + // is applied to VMs that have both the labels `env=test` and `app=web`. + message GroupLabel { + // Compute Engine instance labels that must be present for a VM + // instance to be targeted by this filter. + map labels = 1; + } + + // Target all VM instances in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // Targets VM instances matching ANY of these GroupLabels. This allows + // targeting of disparate groups of VM instances. + repeated GroupLabel group_labels = 2; + + // Targets VM instances in ANY of these zones. Leave empty to target VM + // instances in any zone. + repeated string zones = 3; + + // Targets any of the VM instances specified. Instances are specified by their + // URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`, + // `projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or + // `https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]` + repeated string instances = 4; + + // Targets VMs whose name starts with one of these prefixes. Similar to + // labels, this is another way to group VMs when targeting configs, for + // example prefix="prod-". + repeated string instance_name_prefixes = 5; +} + +// Patch rollout configuration specifications. Contains details on the +// concurrency control when applying patch(es) to all targeted VMs. +message PatchRollout { + // Type of the rollout. + enum Mode { + // Mode must be specified. + MODE_UNSPECIFIED = 0; + + // Patches are applied one zone at a time. The patch job begins in the + // region with the lowest number of targeted VMs. Within the region, + // patching begins in the zone with the lowest number of targeted VMs. If + // multiple regions (or zones within a region) have the same number of + // targeted VMs, a tie-breaker is achieved by sorting the regions or zones + // in alphabetical order. + ZONE_BY_ZONE = 1; + + // Patches are applied to VMs in all zones at the same time. + CONCURRENT_ZONES = 2; + } + + // Mode of the patch rollout. + Mode mode = 1; + + // The maximum number (or percentage) of VMs per zone to disrupt at any given + // moment. The number of VMs calculated from multiplying the percentage by the + // total number of VMs in a zone is rounded up. + // + // During patching, a VM is considered disrupted from the time the agent is + // notified to begin until patching has completed. This disruption time + // includes the time to complete reboot and any post-patch steps. + // + // A VM contributes to the disruption budget if its patching operation fails + // either when applying the patches, running pre or post patch steps, or if it + // fails to respond with a success notification before timing out. VMs that + // are not running or do not have an active agent do not count toward this + // disruption budget. + // + // For zone-by-zone rollouts, if the disruption budget in a zone is exceeded, + // the patch job stops, because continuing to the next zone requires + // completion of the patch process in the previous zone. + // + // For example, if the disruption budget has a fixed value of `10`, and 8 VMs + // fail to patch in the current zone, the patch job continues to patch 2 VMs + // at a time until the zone is completed. When that zone is completed + // successfully, patching begins with 10 VMs at a time in the next zone. If 10 + // VMs in the next zone fail to patch, the patch job stops. + FixedOrPercent disruption_budget = 2; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/vulnerability.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/vulnerability.proto new file mode 100644 index 00000000000..f586776da5f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/cloud/osconfig/v1/vulnerability.proto @@ -0,0 +1,365 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// This API resource represents the vulnerability report for a specified +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// For more information, see [Vulnerability +// reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). +message VulnerabilityReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }; + + // A vulnerability affecting the VM instance. + message Vulnerability { + // Contains metadata information for the vulnerability. This information is + // collected from the upstream feed of the operating system. + message Details { + // A reference for this vulnerability. + message Reference { + // The url of the reference. + string url = 1; + + // The source of the reference e.g. NVD. + string source = 2; + } + + // The CVE of the vulnerability. CVE cannot be + // empty and the combination of should be unique + // across vulnerabilities for a VM. + string cve = 1; + + // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of + // 0 - 10 where 0 indicates low severity and 10 indicates high severity. + float cvss_v2_score = 2; + + // The full description of the CVSSv3 for this vulnerability from NVD. + CVSSv3 cvss_v3 = 3; + + // Assigned severity/impact ranking from the distro. + string severity = 4; + + // The note or description describing the vulnerability from the distro. + string description = 5; + + // Corresponds to the references attached to the `VulnerabilityDetails`. + repeated Reference references = 6; + } + + // OS inventory item that is affected by a vulnerability or fixed as a + // result of a vulnerability. + message Item { + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some + // operating systems, this field might be empty. + string installed_inventory_item_id = 1; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + string available_inventory_item_id = 2; + + // The recommended [CPE URI](https://cpe.mitre.org/specification/) update + // that contains a fix for this vulnerability. + string fixed_cpe_uri = 3; + + // The upstream OS patch, packages or KB that fixes the vulnerability. + string upstream_fix = 4; + } + + // Contains metadata as per the upstream feed of the operating system and + // NVD. + Details details = 1; + + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some distros, + // this field may be empty. + repeated string installed_inventory_item_ids = 2 [deprecated = true]; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + repeated string available_inventory_item_ids = 3 [deprecated = true]; + + // The timestamp for when the vulnerability was first detected. + google.protobuf.Timestamp create_time = 4; + + // The timestamp for when the vulnerability was last modified. + google.protobuf.Timestamp update_time = 5; + + // List of items affected by the vulnerability. + repeated Item items = 6; + } + + // Output only. The `vulnerabilityReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of vulnerabilities affecting the VM. + repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp for when the last vulnerability report was generated for the + // VM. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting the vulnerability report for the specified VM. +message GetVulnerabilityReportRequest { + // Required. API resource name for vulnerability resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + } + ]; +} + +// A request message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListVulnerabilityReports` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `vulnerabilityReport` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsResponse { + // List of vulnerabilityReport objects. + repeated VulnerabilityReport vulnerability_reports = 1; + + // The pagination token to retrieve the next page of vulnerabilityReports + // object. + string next_page_token = 2; +} + +// Common Vulnerability Scoring System version 3. +// For details, see https://www.first.org/cvss/specification-document +message CVSSv3 { + // This metric reflects the context by which vulnerability exploitation is + // possible. + enum AttackVector { + // Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The vulnerable component is bound to the network stack and the set of + // possible attackers extends beyond the other options listed below, up to + // and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1; + + // The vulnerable component is bound to the network stack, but the attack is + // limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2; + + // The vulnerable component is not bound to the network stack and the + // attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3; + + // The attack requires the attacker to physically touch or manipulate the + // vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4; + } + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + enum AttackComplexity { + // Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0; + + // Specialized access conditions or extenuating circumstances do not exist. + // An attacker can expect repeatable success when attacking the vulnerable + // component. + ATTACK_COMPLEXITY_LOW = 1; + + // A successful attack depends on conditions beyond the attacker's control. + // That is, a successful attack cannot be accomplished at will, but requires + // the attacker to invest in some measurable amount of effort in preparation + // or execution against the vulnerable component before a successful attack + // can be expected. + ATTACK_COMPLEXITY_HIGH = 2; + } + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + enum PrivilegesRequired { + // Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + + // The attacker is unauthorized prior to attack, and therefore does not + // require any access to settings or files of the vulnerable system to + // carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1; + + // The attacker requires privileges that provide basic user capabilities + // that could normally affect only settings and files owned by a user. + // Alternatively, an attacker with Low privileges has the ability to access + // only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2; + + // The attacker requires privileges that provide significant (e.g., + // administrative) control over the vulnerable component allowing access to + // component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3; + } + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + enum UserInteraction { + // Invalid value. + USER_INTERACTION_UNSPECIFIED = 0; + + // The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1; + + // Successful exploitation of this vulnerability requires a user to take + // some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2; + } + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + enum Scope { + // Invalid value. + SCOPE_UNSPECIFIED = 0; + + // An exploited vulnerability can only affect resources managed by the same + // security authority. + SCOPE_UNCHANGED = 1; + + // An exploited vulnerability can affect resources beyond the security scope + // managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2; + } + + // The Impact metrics capture the effects of a successfully exploited + // vulnerability on the component that suffers the worst outcome that is most + // directly and predictably associated with the attack. + enum Impact { + // Invalid value. + IMPACT_UNSPECIFIED = 0; + + // High impact. + IMPACT_HIGH = 1; + + // Low impact. + IMPACT_LOW = 2; + + // No impact. + IMPACT_NONE = 3; + } + + // The base score is a function of the base metric scores. + // https://www.first.org/cvss/specification-document#Base-Metrics + float base_score = 1; + + // The Exploitability sub-score equation is derived from the Base + // Exploitability metrics. + // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics + float exploitability_score = 2; + + // The Impact sub-score equation is derived from the Base Impact metrics. + float impact_score = 3; + + // This metric reflects the context by which vulnerability exploitation is + // possible. + AttackVector attack_vector = 5; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 6; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 7; + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + UserInteraction user_interaction = 8; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 9; + + // This metric measures the impact to the confidentiality of the information + // resources managed by a software component due to a successfully exploited + // vulnerability. + Impact confidentiality_impact = 10; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 11; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 12; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/type/device_resources.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/type/device_resources.proto new file mode 100644 index 00000000000..c442283b3ca --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/type/device_resources.proto @@ -0,0 +1,83 @@ +// Copyright 2024 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.identity.accesscontextmanager.type; + +option csharp_namespace = "Google.Identity.AccessContextManager.Type"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type"; +option java_package = "com.google.identity.accesscontextmanager.type"; +option java_multiple_files = true; +option java_outer_classname = "TypeProto"; +option php_namespace = "Google\\Identity\\AccessContextManager\\Type"; +option ruby_package = "Google::Identity::AccessContextManager::Type"; + +// The encryption state of the device. +enum DeviceEncryptionStatus { + // The encryption status of the device is not specified or not known. + ENCRYPTION_UNSPECIFIED = 0; + + // The device does not support encryption. + ENCRYPTION_UNSUPPORTED = 1; + + // The device supports encryption, but is currently unencrypted. + UNENCRYPTED = 2; + + // The device is encrypted. + ENCRYPTED = 3; +} + +// The operating system type of the device. +// Next id: 7 +enum OsType { + // The operating system of the device is not specified or not known. + OS_UNSPECIFIED = 0; + + // A desktop Mac operating system. + DESKTOP_MAC = 1; + + // A desktop Windows operating system. + DESKTOP_WINDOWS = 2; + + // A desktop Linux operating system. + DESKTOP_LINUX = 3; + + // A desktop ChromeOS operating system. + DESKTOP_CHROME_OS = 6; + + // An Android operating system. + ANDROID = 4; + + // An iOS operating system. + IOS = 5; +} + +// The degree to which the device is managed by the Cloud organization. +enum DeviceManagementLevel { + // The device's management level is not specified or not known. + MANAGEMENT_UNSPECIFIED = 0; + + // The device is not managed. + NONE = 1; + + // Basic management is enabled, which is generally limited to monitoring and + // wiping the corporate account. + BASIC = 2; + + // Complete device management. This includes more thorough monitoring and the + // ability to directly manage the device (such as remote wiping). This can be + // enabled through the Android Enterprise Platform. + COMPLETE = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto new file mode 100644 index 00000000000..7563f09a025 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto @@ -0,0 +1,986 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessContextManagerProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// API for setting [access levels] +// [google.identity.accesscontextmanager.v1.AccessLevel] and [service +// perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] +// for Google Cloud projects. Each organization has one [access policy] +// [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the +// [access levels] [google.identity.accesscontextmanager.v1.AccessLevel] +// and [service perimeters] +// [google.identity.accesscontextmanager.v1.ServicePerimeter]. This +// [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is +// applicable to all resources in the organization. +// AccessPolicies +service AccessContextManager { + option (google.api.default_host) = "accesscontextmanager.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all [access policies] + // [google.identity.accesscontextmanager.v1.AccessPolicy] in an + // organization. + rpc ListAccessPolicies(ListAccessPoliciesRequest) returns (ListAccessPoliciesResponse) { + option (google.api.http) = { + get: "/v1/accessPolicies" + }; + } + + // Returns an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] based on the name. + rpc GetAccessPolicy(GetAccessPolicyRequest) returns (AccessPolicy) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an access policy. This method fails if the organization already has + // an access policy. The long-running operation has a successful status + // after the access policy propagates to long-lasting storage. + // Syntactic and basic semantic errors are returned in `metadata` as a + // BadRequest proto. + rpc CreateAccessPolicy(AccessPolicy) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/accessPolicies" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "AccessPolicy" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. The + // long-running operation from this RPC has a successful status after the + // changes to the [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] propagate + // to long-lasting storage. + rpc UpdateAccessPolicy(UpdateAccessPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{policy.name=accessPolicies/*}" + body: "policy" + }; + option (google.api.method_signature) = "policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AccessPolicy" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] based on the + // resource name. The long-running operation has a successful status after the + // [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] + // is removed from long-lasting storage. + rpc DeleteAccessPolicy(DeleteAccessPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] for an access + // policy. + rpc ListAccessLevels(ListAccessLevelsRequest) returns (ListAccessLevelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accessPolicies/*}/accessLevels" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + // name. + rpc GetAccessLevel(GetAccessLevelRequest) returns (AccessLevel) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*/accessLevels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + // operation from this RPC has a successful status after the [access + // level] [google.identity.accesscontextmanager.v1.AccessLevel] + // propagates to long-lasting storage. If [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contain + // errors, an error response is returned for the first error encountered. + rpc CreateAccessLevel(CreateAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/accessLevels" + body: "access_level" + }; + option (google.api.method_signature) = "parent,access_level"; + option (google.longrunning.operation_info) = { + response_type: "AccessLevel" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + // operation from this RPC has a successful status after the changes to + // the [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] propagate + // to long-lasting storage. If [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contain + // errors, an error response is returned for the first error encountered. + rpc UpdateAccessLevel(UpdateAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{access_level.name=accessPolicies/*/accessLevels/*}" + body: "access_level" + }; + option (google.api.method_signature) = "access_level,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AccessLevel" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + // name. The long-running operation from this RPC has a successful status + // after the [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] has been removed + // from long-lasting storage. + rpc DeleteAccessLevel(DeleteAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*/accessLevels/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Replaces all existing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] in an [access + // policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with + // the [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] provided. This + // is done atomically. The long-running operation from this RPC has a + // successful status after all replacements propagate to long-lasting + // storage. If the replacement contains errors, an error response is returned + // for the first error encountered. Upon error, the replacement is cancelled, + // and existing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] are not + // affected. The Operation.response field contains + // ReplaceAccessLevelsResponse. Removing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contained in existing + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] result in an + // error. + rpc ReplaceAccessLevels(ReplaceAccessLevelsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/accessLevels:replaceAll" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ReplaceAccessLevelsResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] for an + // access policy. + rpc ListServicePerimeters(ListServicePerimetersRequest) returns (ListServicePerimetersResponse) { + option (google.api.http) = { + get: "/v1/{parent=accessPolicies/*}/servicePerimeters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + // resource name. + rpc GetServicePerimeter(GetServicePerimeterRequest) returns (ServicePerimeter) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*/servicePerimeters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. The + // long-running operation from this RPC has a successful status after the + // [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] + // propagates to long-lasting storage. If a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + // errors, an error response is returned for the first error encountered. + rpc CreateServicePerimeter(CreateServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters" + body: "service_perimeter" + }; + option (google.api.method_signature) = "parent,service_perimeter"; + option (google.longrunning.operation_info) = { + response_type: "ServicePerimeter" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. The + // long-running operation from this RPC has a successful status after the + // [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] + // propagates to long-lasting storage. If a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + // errors, an error response is returned for the first error encountered. + rpc UpdateServicePerimeter(UpdateServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{service_perimeter.name=accessPolicies/*/servicePerimeters/*}" + body: "service_perimeter" + }; + option (google.api.method_signature) = "service_perimeter,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ServicePerimeter" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + // resource name. The long-running operation from this RPC has a successful + // status after the [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] is removed from + // long-lasting storage. + rpc DeleteServicePerimeter(DeleteServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*/servicePerimeters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Replace all existing [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in an [access + // policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with the + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. This + // is done atomically. The long-running operation from this RPC has a + // successful status after all replacements propagate to long-lasting storage. + // Replacements containing errors result in an error response for the first + // error encountered. Upon an error, replacement are cancelled and existing + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] are not + // affected. The Operation.response field contains + // ReplaceServicePerimetersResponse. + rpc ReplaceServicePerimeters(ReplaceServicePerimetersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters:replaceAll" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ReplaceServicePerimetersResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Commits the dry-run specification for all the [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in an + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + // A commit operation on a service perimeter involves copying its `spec` field + // to the `status` field of the service perimeter. Only [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] with + // `use_explicit_dry_run_spec` field set to true are affected by a commit + // operation. The long-running operation from this RPC has a successful + // status after the dry-run specifications for all the [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] have been + // committed. If a commit fails, it causes the long-running operation to + // return an error response and the entire commit operation is cancelled. + // When successful, the Operation.response field contains + // CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are + // cleared after a successful commit operation. + rpc CommitServicePerimeters(CommitServicePerimetersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters:commit" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "CommitServicePerimetersResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [GcpUserAccessBindings] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] for a + // Google Cloud organization. + rpc ListGcpUserAccessBindings(ListGcpUserAccessBindingsRequest) returns (ListGcpUserAccessBindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/gcpUserAccessBindings" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] with + // the given name. + rpc GetGcpUserAccessBinding(GetGcpUserAccessBindingRequest) returns (GcpUserAccessBinding) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/gcpUserAccessBindings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. If the + // client specifies a [name] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.name], + // the server ignores it. Fails if a resource already exists with the same + // [group_key] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.group_key]. + // Completion of this long-running operation does not necessarily signify that + // the new binding is deployed onto all affected users, which may take more + // time. + rpc CreateGcpUserAccessBinding(CreateGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/gcpUserAccessBindings" + body: "gcp_user_access_binding" + }; + option (google.api.method_signature) = "parent,gcp_user_access_binding"; + option (google.longrunning.operation_info) = { + response_type: "GcpUserAccessBinding" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Updates a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. + // Completion of this long-running operation does not necessarily signify that + // the changed binding is deployed onto all affected users, which may take + // more time. + rpc UpdateGcpUserAccessBinding(UpdateGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{gcp_user_access_binding.name=organizations/*/gcpUserAccessBindings/*}" + body: "gcp_user_access_binding" + }; + option (google.api.method_signature) = "gcp_user_access_binding,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GcpUserAccessBinding" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Deletes a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. + // Completion of this long-running operation does not necessarily signify that + // the binding deletion is deployed onto all affected users, which may take + // more time. + rpc DeleteGcpUserAccessBinding(DeleteGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/gcpUserAccessBindings/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Sets the IAM policy for the specified Access Context Manager + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + // This method replaces the existing IAM policy on the access policy. The IAM + // policy controls the set of users who can perform specific operations on the + // Access Context Manager [access + // policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:setIamPolicy" + body: "*" + }; + } + + // Gets the IAM policy for the specified Access Context Manager + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:getIamPolicy" + body: "*" + }; + } + + // Returns the IAM permissions that the caller has on the specified Access + // Context Manager resource. The resource can be an + // [AccessPolicy][google.identity.accesscontextmanager.v1.AccessPolicy], + // [AccessLevel][google.identity.accesscontextmanager.v1.AccessLevel], or + // [ServicePerimeter][google.identity.accesscontextmanager.v1.ServicePerimeter + // ]. This method does not support other resources. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=accessPolicies/*/accessLevels/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1/{resource=accessPolicies/*/servicePerimeters/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// A request to list all `AccessPolicies` for a container. +message ListAccessPoliciesRequest { + // Required. Resource name for the container to list AccessPolicy instances + // from. + // + // Format: + // `organizations/{org_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Number of AccessPolicy instances to include in the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of AccessPolicy instances. Defaults to + // the first page of results. + string page_token = 3; +} + +// A response to `ListAccessPoliciesRequest`. +message ListAccessPoliciesResponse { + // List of the AccessPolicy instances. + repeated AccessPolicy access_policies = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `AccessPolicy`. +message GetAccessPolicyRequest { + // Required. Resource name for the access policy to get. + // + // Format `accessPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + } + ]; +} + +// A request to update an `AccessPolicy`. +message UpdateAccessPolicyRequest { + // Required. The updated AccessPolicy. + AccessPolicy policy = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an `AccessPolicy`. +message DeleteAccessPolicyRequest { + // Required. Resource name for the access policy to delete. + // + // Format `accessPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + } + ]; +} + +// A request to list all `AccessLevels` in an `AccessPolicy`. +message ListAccessLevelsRequest { + // Required. Resource name for the access policy to list [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] from. + // + // Format: + // `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Number of [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] to include in + // the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + // Defaults to the first page of results. + string page_token = 3; + + // Whether to return `BasicLevels` in the Cloud Common Expression language, as + // `CustomLevels`, rather than as `BasicLevels`. Defaults to returning + // `AccessLevels` in the format they were defined. + LevelFormat access_level_format = 4; +} + +// A response to `ListAccessLevelsRequest`. +message ListAccessLevelsResponse { + // List of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + repeated AccessLevel access_levels = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `AccessLevel`. +message GetAccessLevelRequest { + // Required. Resource name for the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: + // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Whether to return `BasicLevels` in the Cloud Common Expression + // Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where + // [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel] + // are returned as `BasicLevels` or `CustomLevels` based on how they were + // created. If set to CEL, all [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] are returned as + // `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent + // `CustomLevels`. + LevelFormat access_level_format = 2; +} + +// A request to create an `AccessLevel`. +message CreateAccessLevelRequest { + // Required. Resource name for the access policy which owns this [Access + // Level] [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Required. The [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] to create. + // Syntactic correctness of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] is a + // precondition for creation. + AccessLevel access_level = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update an `AccessLevel`. +message UpdateAccessLevelRequest { + // Required. The updated [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. Syntactic + // correctness of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] is a + // precondition for creation. + AccessLevel access_level = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an `AccessLevel`. +message DeleteAccessLevelRequest { + // Required. Resource name for the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: + // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; +} + +// A request to replace all existing Access Levels in an Access Policy with +// the Access Levels provided. This is done atomically. +message ReplaceAccessLevelsRequest { + // Required. Resource name for the access policy which owns these + // [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Required. The desired [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] that should + // replace all existing [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] in the + // [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated AccessLevel access_levels = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // replace operation is to be performed on. If, at the time of replace, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the replace operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 4; +} + +// A response to ReplaceAccessLevelsRequest. This will be put inside of +// Operation.response field. +message ReplaceAccessLevelsResponse { + // List of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + repeated AccessLevel access_levels = 1; +} + +// A request to list all `ServicePerimeters` in an `AccessPolicy`. +message ListServicePerimetersRequest { + // Required. Resource name for the access policy to list [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] from. + // + // Format: + // `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Number of [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to include + // in the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + // Defaults to the first page of results. + string page_token = 3; +} + +// A response to `ListServicePerimetersRequest`. +message ListServicePerimetersResponse { + // List of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + repeated ServicePerimeter service_perimeters = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `ServicePerimeter`. +message GetServicePerimeterRequest { + // Required. Resource name for the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: + // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; +} + +// A request to create a `ServicePerimeter`. +message CreateServicePerimeterRequest { + // Required. Resource name for the access policy which owns this [Service + // Perimeter] [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Required. The [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to create. + // Syntactic correctness of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] is a + // precondition for creation. + ServicePerimeter service_perimeter = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update a `ServicePerimeter`. +message UpdateServicePerimeterRequest { + // Required. The updated `ServicePerimeter`. Syntactic correctness of the + // `ServicePerimeter` is a precondition for creation. + ServicePerimeter service_perimeter = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete a `ServicePerimeter`. +message DeleteServicePerimeterRequest { + // Required. Resource name for the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: + // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; +} + +// A request to replace all existing Service Perimeters in an Access Policy +// with the Service Perimeters provided. This is done atomically. +message ReplaceServicePerimetersRequest { + // Required. Resource name for the access policy which owns these + // [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Required. The desired [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] that should + // replace all existing [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in the + // [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated ServicePerimeter service_perimeters = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // replace operation is to be performed on. If, at the time of replace, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the replace operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 3; +} + +// A response to ReplaceServicePerimetersRequest. This will be put inside of +// Operation.response field. +message ReplaceServicePerimetersResponse { + // List of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + repeated ServicePerimeter service_perimeters = 1; +} + +// A request to commit dry-run specs in all [Service Perimeters] +// [google.identity.accesscontextmanager.v1.ServicePerimeter] belonging to +// an [Access Policy][google.identity.accesscontextmanager.v1.AccessPolicy]. +message CommitServicePerimetersRequest { + // Required. Resource name for the parent [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] which owns all + // [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in scope for + // the commit operation. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // commit operation is to be performed on. If, at the time of commit, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the commit operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 2; +} + +// A response to CommitServicePerimetersRequest. This will be put inside of +// Operation.response field. +message CommitServicePerimetersResponse { + // List of all the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances in + // the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated ServicePerimeter service_perimeters = 1; +} + +// The format used in an `AccessLevel`. +enum LevelFormat { + // The format was not specified. + LEVEL_FORMAT_UNSPECIFIED = 0; + + // Uses the format the resource was defined in. BasicLevels are returned as + // BasicLevels, CustomLevels are returned as CustomLevels. + AS_DEFINED = 1; + + // Use Cloud Common Expression Language when returning the resource. Both + // BasicLevels and CustomLevels are returned as CustomLevels. + CEL = 2; +} + +// Request of [ListGcpUserAccessBindings] +// [google.identity.accesscontextmanager.v1.AccessContextManager.ListGcpUserAccessBindings]. +message ListGcpUserAccessBindingsRequest { + // Required. Example: "organizations/256" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Optional. Maximum number of items to return. The server may return fewer items. + // If left blank, the server may return any number of items. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If left blank, returns the first page. To enumerate all items, use the + // [next_page_token] + // [google.identity.accesscontextmanager.v1.ListGcpUserAccessBindingsResponse.next_page_token] + // from your previous list operation. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of [ListGcpUserAccessBindings] +// [google.identity.accesscontextmanager.v1.AccessContextManager.ListGcpUserAccessBindings]. +message ListGcpUserAccessBindingsResponse { + // [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + repeated GcpUserAccessBinding gcp_user_access_bindings = 1; + + // Token to get the next page of items. If blank, there are no more items. + string next_page_token = 2; +} + +// Request of [GetGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.GetGcpUserAccessBinding]. +message GetGcpUserAccessBindingRequest { + // Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + } + ]; +} + +// Request of [CreateGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.CreateGcpUserAccessBinding]. +message CreateGcpUserAccessBindingRequest { + // Required. Example: "organizations/256" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + GcpUserAccessBinding gcp_user_access_binding = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request of [UpdateGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.UpdateGcpUserAccessBinding]. +message UpdateGcpUserAccessBindingRequest { + // Required. [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + GcpUserAccessBinding gcp_user_access_binding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only the fields specified in this mask are updated. Because name and + // group_key cannot be changed, update_mask is required and must always be: + // + // update_mask { + // paths: "access_levels" + // } + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request of [DeleteGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.DeleteGcpUserAccessBinding]. +message DeleteGcpUserAccessBindingRequest { + // Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + } + ]; +} + +// Currently, a completed operation means nothing. In the future, this metadata +// and a completed operation may indicate that the binding has taken effect and +// is affecting access decisions for all users. +message GcpUserAccessBindingOperationMetadata { + +} + +// Metadata of Access Context Manager's Long Running Operations. +message AccessContextManagerOperationMetadata { + +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_level.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_level.proto new file mode 100644 index 00000000000..204b74a8290 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_level.proto @@ -0,0 +1,192 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/identity/accesscontextmanager/type/device_resources.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessLevelProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// An `AccessLevel` is a label that can be applied to requests to Google Cloud +// services, along with a list of requirements necessary for the label to be +// applied. +message AccessLevel { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + pattern: "accessPolicies/{access_policy}/accessLevels/{access_level}" + }; + + // Required. Resource name for the Access Level. The `short_name` component + // must begin with a letter and only include alphanumeric and '_'. Format: + // `accessPolicies/{access_policy}/accessLevels/{access_level}`. The maximum + // length of the `access_level` component is 50 characters. + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `AccessLevel` and its use. Does not affect behavior. + string description = 3; + + // Required. Describes the necessary conditions for the level to apply. + oneof level { + // A `BasicLevel` composed of `Conditions`. + BasicLevel basic = 4; + + // A `CustomLevel` written in the Common Expression Language. + CustomLevel custom = 5; + } + + // Output only. Time the `AccessLevel` was created in UTC. + google.protobuf.Timestamp create_time = 6; + + // Output only. Time the `AccessLevel` was updated in UTC. + google.protobuf.Timestamp update_time = 7; +} + +// `BasicLevel` is an `AccessLevel` using a set of recommended features. +message BasicLevel { + // Options for how the `conditions` list should be combined to determine if + // this `AccessLevel` is applied. Default is AND. + enum ConditionCombiningFunction { + // All `Conditions` must be true for the `BasicLevel` to be true. + AND = 0; + + // If at least one `Condition` is true, then the `BasicLevel` is true. + OR = 1; + } + + // Required. A list of requirements for the `AccessLevel` to be granted. + repeated Condition conditions = 1; + + // How the `conditions` list should be combined to determine if a request is + // granted this `AccessLevel`. If AND is used, each `Condition` in + // `conditions` must be satisfied for the `AccessLevel` to be applied. If OR + // is used, at least one `Condition` in `conditions` must be satisfied for the + // `AccessLevel` to be applied. Default behavior is AND. + ConditionCombiningFunction combining_function = 2; +} + +// A condition necessary for an `AccessLevel` to be granted. The Condition is an +// AND over its fields. So a Condition is true if: 1) the request IP is from one +// of the listed subnetworks AND 2) the originating device complies with the +// listed device policy AND 3) all listed access levels are granted AND 4) the +// request was sent at a time allowed by the DateTimeRestriction. +message Condition { + // CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for + // a CIDR IP address block, the specified IP address portion must be properly + // truncated (i.e. all the host bits must be zero) or the input is considered + // malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is + // not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas + // "2001:db8::1/32" is not. The originating IP of a request must be in one of + // the listed subnets in order for this Condition to be true. If empty, all IP + // addresses are allowed. + repeated string ip_subnetworks = 1; + + // Device specific restrictions, all restrictions must hold for the + // Condition to be true. If not specified, all devices are allowed. + DevicePolicy device_policy = 2; + + // A list of other access levels defined in the same `Policy`, referenced by + // resource name. Referencing an `AccessLevel` which does not exist is an + // error. All access levels listed must be granted for the Condition + // to be true. Example: + // "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` + repeated string required_access_levels = 3; + + // Whether to negate the Condition. If true, the Condition becomes a NAND over + // its non-empty fields, each field must be false for the Condition overall to + // be satisfied. Defaults to false. + bool negate = 5; + + // The request must be made by one of the provided user or service + // accounts. Groups are not supported. + // Syntax: + // `user:{emailid}` + // `serviceAccount:{emailid}` + // If not specified, a request may come from any user. + repeated string members = 6; + + // The request must originate from one of the provided countries/regions. + // Must be valid ISO 3166-1 alpha-2 codes. + repeated string regions = 7; +} + +// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +// to represent the necessary conditions for the level to apply to a request. +// See CEL spec at: https://github.com/google/cel-spec +message CustomLevel { + // Required. A Cloud CEL expression evaluating to a boolean. + google.type.Expr expr = 1; +} + +// `DevicePolicy` specifies device specific restrictions necessary to acquire a +// given access level. A `DevicePolicy` specifies requirements for requests from +// devices to be granted access levels, it does not do any enforcement on the +// device. `DevicePolicy` acts as an AND over all specified fields, and each +// repeated field is an OR over its elements. Any unset fields are ignored. For +// example, if the proto is { os_type : DESKTOP_WINDOWS, os_type : +// DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be +// true for requests originating from encrypted Linux desktops and encrypted +// Windows desktops. +message DevicePolicy { + // Whether or not screenlock is required for the DevicePolicy to be true. + // Defaults to `false`. + bool require_screenlock = 1; + + // Allowed encryptions statuses, an empty list allows all statuses. + repeated google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + + // Allowed OS versions, an empty list allows all types and all versions. + repeated OsConstraint os_constraints = 3; + + // Allowed device management levels, an empty list allows all management + // levels. + repeated google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + + // Whether the device needs to be approved by the customer admin. + bool require_admin_approval = 7; + + // Whether the device needs to be corp owned. + bool require_corp_owned = 8; +} + +// A restriction on the OS type and version of devices making requests. +message OsConstraint { + // Required. The allowed OS type. + google.identity.accesscontextmanager.type.OsType os_type = 1; + + // The minimum allowed OS version. If not set, any version of this OS + // satisfies the constraint. Format: `"major.minor.patch"`. + // Examples: `"10.5.301"`, `"9.2.1"`. + string minimum_version = 2; + + // Only allows requests from devices with a verified Chrome OS. + // Verifications includes requirements that the device is enterprise-managed, + // conformant to domain policies, and the caller has permission to call + // the API targeted by the request. + bool require_verified_chrome_os = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_policy.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_policy.proto new file mode 100644 index 00000000000..65b574d9375 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/access_policy.proto @@ -0,0 +1,81 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// `AccessPolicy` is a container for `AccessLevels` (which define the necessary +// attributes to use Google Cloud services) and `ServicePerimeters` (which +// define regions of services able to freely pass data within a perimeter). An +// access policy is globally visible within an organization, and the +// restrictions it specifies apply to all projects within an organization. +message AccessPolicy { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + pattern: "accessPolicies/{access_policy}" + }; + + // Output only. Resource name of the `AccessPolicy`. Format: + // `accessPolicies/{access_policy}` + string name = 1; + + // Required. The parent of this `AccessPolicy` in the Cloud Resource + // Hierarchy. Currently immutable once created. Format: + // `organizations/{organization_id}` + string parent = 2; + + // Required. Human readable title. Does not affect behavior. + string title = 3; + + // The scopes of a policy define which resources an ACM policy can restrict, + // and where ACM resources can be referenced. + // For example, a policy with scopes=["folders/123"] has the following + // behavior: + // - vpcsc perimeters can only restrict projects within folders/123 + // - access levels can only be referenced by resources within folders/123. + // If empty, there are no limitations on which resources can be restricted by + // an ACM policy, and there are no limitations on where ACM resources can be + // referenced. + // Only one policy can include a given scope (attempting to create a second + // policy which includes "folders/123" will result in an error). + // Currently, scopes cannot be modified after a policy is created. + // Currently, policies can only have a single scope. + // Format: list of `folders/{folder_number}` or `projects/{project_number}` + repeated string scopes = 7; + + // Output only. Time the `AccessPolicy` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `AccessPolicy` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Output only. An opaque identifier for the current version of the + // `AccessPolicy`. This will always be a strongly validated etag, meaning that + // two Access Polices will be identical if and only if their etags are + // identical. Clients should not expect this to be in any specific format. + string etag = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto new file mode 100644 index 00000000000..ced18e9f9ed --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto @@ -0,0 +1,68 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "GcpUserAccessBindingProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// Restricts access to Cloud Console and Google Cloud APIs for a set of users +// using Context-Aware Access. +message GcpUserAccessBinding { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + pattern: "organizations/{organization}/gcpUserAccessBindings/{gcp_user_access_binding}" + }; + + // Immutable. Assigned by the server during creation. The last segment has an arbitrary + // length and has only URI unreserved characters (as defined by + // [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)). + // Should not be specified by the client during creation. + // Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. Google Group id whose members are subject to this binding's restrictions. + // See "id" in the [G Suite Directory API's Groups resource] + // (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource). + // If a group's email address/alias is changed, this resource will continue + // to point at the changed group. This field does not accept group email + // addresses or aliases. + // Example: "01d520gv4vjcrht" + string group_key = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Access level that a user must have to be granted access. Only one access + // level is supported, not multiple. This repeated field must have exactly + // one element. + // Example: "accessPolicies/9522/accessLevels/device_trusted" + repeated string access_levels = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto new file mode 100644 index 00000000000..d135380e788 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto @@ -0,0 +1,472 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "ServicePerimeterProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// `ServicePerimeter` describes a set of Google Cloud resources which can freely +// import and export data amongst themselves, but not export outside of the +// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` +// has a target outside of the `ServicePerimeter`, the request will be blocked. +// Otherwise the request is allowed. There are two types of Service Perimeter - +// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +// Google Cloud project can only belong to a single regular Service Perimeter. +// Service Perimeter Bridges can contain only Google Cloud projects as members, +// a single Google Cloud project may belong to multiple Service Perimeter +// Bridges. +message ServicePerimeter { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + pattern: "accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}" + }; + + // Specifies the type of the Perimeter. There are two types: regular and + // bridge. Regular Service Perimeter contains resources, access levels, and + // restricted services. Every resource can be in at most ONE + // regular Service Perimeter. + // + // In addition to being in a regular service perimeter, a resource can also + // be in zero or more perimeter bridges. A perimeter bridge only contains + // resources. Cross project operations are permitted if all effected + // resources share some perimeter (whether bridge or regular). Perimeter + // Bridge does not contain access levels or services: those are governed + // entirely by the regular perimeter that resource is in. + // + // Perimeter Bridges are typically useful when building more complex toplogies + // with many independent perimeters that need to share some data with a common + // perimeter, but should not be able to share data among themselves. + enum PerimeterType { + // Regular Perimeter. + PERIMETER_TYPE_REGULAR = 0; + + // Perimeter Bridge. + PERIMETER_TYPE_BRIDGE = 1; + } + + // Required. Resource name for the ServicePerimeter. The `short_name` + // component must begin with a letter and only include alphanumeric and '_'. + // Format: + // `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}` + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `ServicePerimeter` and its use. Does not affect + // behavior. + string description = 3; + + // Output only. Time the `ServicePerimeter` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `ServicePerimeter` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Perimeter type indicator. A single project is + // allowed to be a member of single regular perimeter, but multiple service + // perimeter bridges. A project cannot be a included in a perimeter bridge + // without being included in regular perimeter. For perimeter bridges, + // the restricted service list as well as access level lists must be + // empty. + PerimeterType perimeter_type = 6; + + // Current ServicePerimeter configuration. Specifies sets of resources, + // restricted services and access levels that determine perimeter + // content and boundaries. + ServicePerimeterConfig status = 7; + + // Proposed (or dry run) ServicePerimeter configuration. This configuration + // allows to specify and test ServicePerimeter configuration without enforcing + // actual access restrictions. Only allowed to be set when the + // "use_explicit_dry_run_spec" flag is set. + ServicePerimeterConfig spec = 8; + + // Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly + // exists for all Service Perimeters, and that spec is identical to the + // status for those Service Perimeters. When this flag is set, it inhibits the + // generation of the implicit spec, thereby allowing the user to explicitly + // provide a configuration ("spec") to use in a dry-run version of the Service + // Perimeter. This allows the user to test changes to the enforced config + // ("status") without actually enforcing them. This testing is done through + // analyzing the differences between currently enforced and suggested + // restrictions. use_explicit_dry_run_spec must bet set to True if any of the + // fields in the spec are set to non-default values. + bool use_explicit_dry_run_spec = 9; +} + +// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +// describe specific Service Perimeter configuration. +message ServicePerimeterConfig { + // Specifies how APIs are allowed to communicate within the Service + // Perimeter. + message VpcAccessibleServices { + // Whether to restrict API calls within the Service Perimeter to the list of + // APIs specified in 'allowed_services'. + bool enable_restriction = 1; + + // The list of APIs usable within the Service Perimeter. Must be empty + // unless 'enable_restriction' is True. You can specify a list of individual + // services, as well as include the 'RESTRICTED-SERVICES' value, which + // automatically includes all of the services protected by the perimeter. + repeated string allowed_services = 2; + } + + // Specifies the types of identities that are allowed access in either + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] + // or [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom] + // rules. + enum IdentityType { + // No blanket identity group specified. + IDENTITY_TYPE_UNSPECIFIED = 0; + + // Authorize access from all identities outside the perimeter. + ANY_IDENTITY = 1; + + // Authorize access from all human users outside the perimeter. + ANY_USER_ACCOUNT = 2; + + // Authorize access from all service accounts outside the perimeter. + ANY_SERVICE_ACCOUNT = 3; + } + + // An allowed method or permission of a service specified in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + message MethodSelector { + // The API method name or Cloud IAM permission name to allow. + oneof kind { + // Value for `method` should be a valid method name for the corresponding + // `service_name` in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + // If `*` used as value for `method`, then ALL methods and permissions are + // allowed. + string method = 1; + + // Value for `permission` should be a valid Cloud IAM permission for the + // corresponding `service_name` in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + string permission = 2; + } + } + + // Identification for an API Operation. + message ApiOperation { + // The name of the API whose methods or permissions the [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // or [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // want to allow. A single [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // with `service_name` field set to `*` will allow all methods AND + // permissions for all services. + string service_name = 1; + + // API methods or permissions to allow. Method or permission must belong to + // the service specified by `service_name` field. A single [MethodSelector] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector] + // entry with `*` specified for the `method` field will allow all methods + // AND permissions for the service specified in `service_name`. + repeated MethodSelector method_selectors = 2; + } + + // The source that [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // authorizes access from. + message IngressSource { + // Allowed ingress source. It can be one of [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] or Google + // Cloud resource. + oneof source { + // An [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] resource + // name that allow resources within the [ServicePerimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to be + // accessed from the internet. [AccessLevels] + // [google.identity.accesscontextmanager.v1.AccessLevel] listed must + // be in the same policy as this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // Referencing a nonexistent [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] will cause + // an error. If no [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `accessPolicies/MY_POLICY/accessLevels/MY_LEVEL`. If a single `*` is + // specified for `access_level`, then all [IngressSources] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource] + // will be allowed. + string access_level = 1; + + // A Google Cloud resource that is allowed to ingress the perimeter. + // Requests from these resources will be allowed to access perimeter data. + // Currently only projects are allowed. + // Format: `projects/{project_number}` + // The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, the + // case of allowing all Google Cloud resources only is not supported. + string resource = 2; + } + } + + // Defines the conditions under which an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request. Conditions are based on information about the source of + // the request. The request must satisfy what is defined in `sources` AND + // identity related fields in order to match. + message IngressFrom { + // Sources that this [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // authorizes access from. + repeated IngressSource sources = 1; + + // A list of identities that are allowed access through this ingress + // policy. Should be in the format of email address. The email address + // should represent individual user or service account only. + repeated string identities = 2; + + // Specifies the type of identities that are allowed access from outside the + // perimeter. If left unspecified, then members of `identities` field will + // be allowed access. + IdentityType identity_type = 3; + } + + // Defines the conditions under which an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request. Conditions are based on information about the + // [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // intended to be performed on the target resource of the request. The request + // must satisfy what is defined in `operations` AND `resources` in order to + // match. + message IngressTo { + // A list of [ApiOperations] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // allowed to be performed by the sources specified in corresponding + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] + // in this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + repeated ApiOperation operations = 1; + + // A list of resources, currently only projects in the form + // `projects/`, protected by this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] that are + // allowed to be accessed by sources defined in the corresponding + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom]. + // If a single `*` is specified, then access to all resources inside the + // perimeter are allowed. + repeated string resources = 2; + } + + // Policy for ingress into [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // match requests based on `ingress_from` and `ingress_to` stanzas. For an + // ingress policy to match, both the `ingress_from` and `ingress_to` stanzas + // must be matched. If an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request, the request is allowed through the perimeter boundary + // from outside the perimeter. + // + // For example, access from the internet can be allowed either + // based on an [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] or, for traffic + // hosted on Google Cloud, the project of the source network. For access from + // private networks, using the project of the hosting network is required. + // + // Individual ingress policies can be limited by restricting which + // services and/or actions they match using the `ingress_to` field. + message IngressPolicy { + // Defines the conditions on the source of a request causing this + // [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply. + IngressFrom ingress_from = 1; + + // Defines the conditions on the [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // and request destination that cause this [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply. + IngressTo ingress_to = 2; + } + + // Defines the conditions under which an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request. Conditions based on information about the source of the + // request. Note that if the destination of the request is also protected by a + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + // an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // which allows access in order for this request to succeed. + message EgressFrom { + // A list of identities that are allowed access through this [EgressPolicy]. + // Should be in the format of email address. The email address should + // represent individual user or service account only. + repeated string identities = 1; + + // Specifies the type of identities that are allowed access to outside the + // perimeter. If left unspecified, then members of `identities` field will + // be allowed access. + IdentityType identity_type = 2; + } + + // Defines the conditions under which an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request. Conditions are based on information about the + // [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // intended to be performed on the `resources` specified. Note that if the + // destination of the request is also protected by a [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + // an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // which allows access in order for this request to succeed. The request must + // match `operations` AND `resources` fields in order to be allowed egress out + // of the perimeter. + message EgressTo { + // A list of resources, currently only projects in the form + // `projects/`, that are allowed to be accessed by sources + // defined in the corresponding [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + // A request matches if it contains a resource in this list. If `*` is + // specified for `resources`, then this [EgressTo] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo] + // rule will authorize access to all resources outside the perimeter. + repeated string resources = 1; + + // A list of [ApiOperations] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // allowed to be performed by the sources specified in the corresponding + // [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + // A request matches if it uses an operation/service in this list. + repeated ApiOperation operations = 2; + + // A list of external resources that are allowed to be accessed. Only AWS + // and Azure resources are supported. For Amazon S3, the supported format is + // s3://BUCKET_NAME. For Azure Storage, the supported format is + // azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches + // if it contains an external resource in this list (Example: + // s3://bucket/path). Currently '*' is not allowed. + repeated string external_resources = 3; + } + + // Policy for egress from perimeter. + // + // [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // match requests based on `egress_from` and `egress_to` stanzas. For an + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to match, both `egress_from` and `egress_to` stanzas must be matched. If an + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request, the request is allowed to span the [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] boundary. + // For example, an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // can be used to allow VMs on networks within the [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to access a + // defined set of projects outside the perimeter in certain contexts (e.g. to + // read data from a Cloud Storage bucket or query against a BigQuery dataset). + // + // [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // are concerned with the *resources* that a request relates as well as the + // API services and API actions being used. They do not related to the + // direction of data movement. More detailed documentation for this concept + // can be found in the descriptions of [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom] + // and [EgressTo] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo]. + message EgressPolicy { + // Defines conditions on the source of a request causing this [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply. + EgressFrom egress_from = 1; + + // Defines the conditions on the [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // and destination resources that cause this [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply. + EgressTo egress_to = 2; + } + + // A list of Google Cloud resources that are inside of the service perimeter. + // Currently only projects are allowed. Format: `projects/{project_number}` + repeated string resources = 1; + + // A list of `AccessLevel` resource names that allow resources within the + // `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed + // must be in the same policy as this `ServicePerimeter`. Referencing a + // nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. + // For Service Perimeter Bridge, must be empty. + repeated string access_levels = 2; + + // Google Cloud services that are subject to the Service Perimeter + // restrictions. For example, if `storage.googleapis.com` is specified, access + // to the storage buckets inside the perimeter must meet the perimeter's + // access restrictions. + repeated string restricted_services = 4; + + // Configuration for APIs allowed within Perimeter. + VpcAccessibleServices vpc_accessible_services = 10; + + // List of [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply to the perimeter. A perimeter may have multiple [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy], + // each of which is evaluated separately. Access is granted if any [Ingress + // Policy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // grants it. Must be empty for a perimeter bridge. + repeated IngressPolicy ingress_policies = 8; + + // List of [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply to the perimeter. A perimeter may have multiple [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy], + // each of which is evaluated separately. Access is granted if any + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // grants it. Must be empty for a perimeter bridge. + repeated EgressPolicy egress_policies = 9; +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/protos.d.ts b/owl-bot-staging/google-cloud-asset/v1/protos/protos.d.ts new file mode 100644 index 00000000000..084be6163df --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/protos.d.ts @@ -0,0 +1,26381 @@ +// Copyright 2024 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace asset. */ + namespace asset { + + /** Namespace v1. */ + namespace v1 { + + /** 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 ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest, callback: google.cloud.asset.v1.AssetService.ExportAssetsCallback): void; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise + */ + public exportAssets(request: google.cloud.asset.v1.IExportAssetsRequest): Promise; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.asset.v1.IListAssetsRequest, callback: google.cloud.asset.v1.AssetService.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.asset.v1.IListAssetsRequest): Promise; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, callback: google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback): void; + + /** + * Calls BatchGetAssetsHistory. + * @param request BatchGetAssetsHistoryRequest message or plain object + * @returns Promise + */ + public batchGetAssetsHistory(request: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): Promise; + + /** + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest, callback: google.cloud.asset.v1.AssetService.CreateFeedCallback): void; + + /** + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise + */ + public createFeed(request: google.cloud.asset.v1.ICreateFeedRequest): Promise; + + /** + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest, callback: google.cloud.asset.v1.AssetService.GetFeedCallback): void; + + /** + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise + */ + public getFeed(request: google.cloud.asset.v1.IGetFeedRequest): Promise; + + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest, callback: google.cloud.asset.v1.AssetService.ListFeedsCallback): void; + + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise + */ + public listFeeds(request: google.cloud.asset.v1.IListFeedsRequest): Promise; + + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest, callback: google.cloud.asset.v1.AssetService.UpdateFeedCallback): void; + + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise + */ + public updateFeed(request: google.cloud.asset.v1.IUpdateFeedRequest): Promise; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest, callback: google.cloud.asset.v1.AssetService.DeleteFeedCallback): void; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise + */ + public deleteFeed(request: google.cloud.asset.v1.IDeleteFeedRequest): Promise; + + /** + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + */ + public searchAllResources(request: google.cloud.asset.v1.ISearchAllResourcesRequest, callback: google.cloud.asset.v1.AssetService.SearchAllResourcesCallback): void; + + /** + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object + * @returns Promise + */ + public searchAllResources(request: google.cloud.asset.v1.ISearchAllResourcesRequest): Promise; + + /** + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + */ + public searchAllIamPolicies(request: google.cloud.asset.v1.ISearchAllIamPoliciesRequest, callback: google.cloud.asset.v1.AssetService.SearchAllIamPoliciesCallback): void; + + /** + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object + * @returns Promise + */ + public searchAllIamPolicies(request: google.cloud.asset.v1.ISearchAllIamPoliciesRequest): Promise; + + /** + * 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.v1.IAnalyzeIamPolicyRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeIamPolicyCallback): void; + + /** + * Calls AnalyzeIamPolicy. + * @param request AnalyzeIamPolicyRequest message or plain object + * @returns Promise + */ + public analyzeIamPolicy(request: google.cloud.asset.v1.IAnalyzeIamPolicyRequest): Promise; + + /** + * Calls AnalyzeIamPolicyLongrunning. + * @param request AnalyzeIamPolicyLongrunningRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public analyzeIamPolicyLongrunning(request: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunningCallback): void; + + /** + * Calls AnalyzeIamPolicyLongrunning. + * @param request AnalyzeIamPolicyLongrunningRequest message or plain object + * @returns Promise + */ + public analyzeIamPolicyLongrunning(request: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest): Promise; + + /** + * Calls AnalyzeMove. + * @param request AnalyzeMoveRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeMoveResponse + */ + public analyzeMove(request: google.cloud.asset.v1.IAnalyzeMoveRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeMoveCallback): void; + + /** + * Calls AnalyzeMove. + * @param request AnalyzeMoveRequest message or plain object + * @returns Promise + */ + public analyzeMove(request: google.cloud.asset.v1.IAnalyzeMoveRequest): Promise; + + /** + * Calls QueryAssets. + * @param request QueryAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QueryAssetsResponse + */ + public queryAssets(request: google.cloud.asset.v1.IQueryAssetsRequest, callback: google.cloud.asset.v1.AssetService.QueryAssetsCallback): void; + + /** + * Calls QueryAssets. + * @param request QueryAssetsRequest message or plain object + * @returns Promise + */ + public queryAssets(request: google.cloud.asset.v1.IQueryAssetsRequest): Promise; + + /** + * Calls CreateSavedQuery. + * @param request CreateSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public createSavedQuery(request: google.cloud.asset.v1.ICreateSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.CreateSavedQueryCallback): void; + + /** + * Calls CreateSavedQuery. + * @param request CreateSavedQueryRequest message or plain object + * @returns Promise + */ + public createSavedQuery(request: google.cloud.asset.v1.ICreateSavedQueryRequest): Promise; + + /** + * Calls GetSavedQuery. + * @param request GetSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public getSavedQuery(request: google.cloud.asset.v1.IGetSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.GetSavedQueryCallback): void; + + /** + * Calls GetSavedQuery. + * @param request GetSavedQueryRequest message or plain object + * @returns Promise + */ + public getSavedQuery(request: google.cloud.asset.v1.IGetSavedQueryRequest): Promise; + + /** + * Calls ListSavedQueries. + * @param request ListSavedQueriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSavedQueriesResponse + */ + public listSavedQueries(request: google.cloud.asset.v1.IListSavedQueriesRequest, callback: google.cloud.asset.v1.AssetService.ListSavedQueriesCallback): void; + + /** + * Calls ListSavedQueries. + * @param request ListSavedQueriesRequest message or plain object + * @returns Promise + */ + public listSavedQueries(request: google.cloud.asset.v1.IListSavedQueriesRequest): Promise; + + /** + * Calls UpdateSavedQuery. + * @param request UpdateSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SavedQuery + */ + public updateSavedQuery(request: google.cloud.asset.v1.IUpdateSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.UpdateSavedQueryCallback): void; + + /** + * Calls UpdateSavedQuery. + * @param request UpdateSavedQueryRequest message or plain object + * @returns Promise + */ + public updateSavedQuery(request: google.cloud.asset.v1.IUpdateSavedQueryRequest): Promise; + + /** + * Calls DeleteSavedQuery. + * @param request DeleteSavedQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSavedQuery(request: google.cloud.asset.v1.IDeleteSavedQueryRequest, callback: google.cloud.asset.v1.AssetService.DeleteSavedQueryCallback): void; + + /** + * Calls DeleteSavedQuery. + * @param request DeleteSavedQueryRequest message or plain object + * @returns Promise + */ + public deleteSavedQuery(request: google.cloud.asset.v1.IDeleteSavedQueryRequest): Promise; + + /** + * Calls BatchGetEffectiveIamPolicies. + * @param request BatchGetEffectiveIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchGetEffectiveIamPoliciesResponse + */ + public batchGetEffectiveIamPolicies(request: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, callback: google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPoliciesCallback): void; + + /** + * Calls BatchGetEffectiveIamPolicies. + * @param request BatchGetEffectiveIamPoliciesRequest message or plain object + * @returns Promise + */ + public batchGetEffectiveIamPolicies(request: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest): Promise; + + /** + * Calls AnalyzeOrgPolicies. + * @param request AnalyzeOrgPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeOrgPoliciesResponse + */ + public analyzeOrgPolicies(request: google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeOrgPoliciesCallback): void; + + /** + * Calls AnalyzeOrgPolicies. + * @param request AnalyzeOrgPoliciesRequest message or plain object + * @returns Promise + */ + public analyzeOrgPolicies(request: google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest): Promise; + + /** + * Calls AnalyzeOrgPolicyGovernedContainers. + * @param request AnalyzeOrgPolicyGovernedContainersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeOrgPolicyGovernedContainersResponse + */ + public analyzeOrgPolicyGovernedContainers(request: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedContainersCallback): void; + + /** + * Calls AnalyzeOrgPolicyGovernedContainers. + * @param request AnalyzeOrgPolicyGovernedContainersRequest message or plain object + * @returns Promise + */ + public analyzeOrgPolicyGovernedContainers(request: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest): Promise; + + /** + * Calls AnalyzeOrgPolicyGovernedAssets. + * @param request AnalyzeOrgPolicyGovernedAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeOrgPolicyGovernedAssetsResponse + */ + public analyzeOrgPolicyGovernedAssets(request: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, callback: google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedAssetsCallback): void; + + /** + * Calls AnalyzeOrgPolicyGovernedAssets. + * @param request AnalyzeOrgPolicyGovernedAssetsRequest message or plain object + * @returns Promise + */ + public analyzeOrgPolicyGovernedAssets(request: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|exportAssets}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|batchGetAssetsHistory}. + * @param error Error, if any + * @param [response] BatchGetAssetsHistoryResponse + */ + type BatchGetAssetsHistoryCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetAssetsHistoryResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|createFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|getFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse + */ + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListFeedsResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|updateFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|deleteFeed}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|searchAllResources}. + * @param error Error, if any + * @param [response] SearchAllResourcesResponse + */ + type SearchAllResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllResourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|searchAllIamPolicies}. + * @param error Error, if any + * @param [response] SearchAllIamPoliciesResponse + */ + type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.SearchAllIamPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeIamPolicy}. + * @param error Error, if any + * @param [response] AnalyzeIamPolicyResponse + */ + type AnalyzeIamPolicyCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeIamPolicyResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeIamPolicyLongrunning}. + * @param error Error, if any + * @param [response] Operation + */ + type AnalyzeIamPolicyLongrunningCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeMove}. + * @param error Error, if any + * @param [response] AnalyzeMoveResponse + */ + type AnalyzeMoveCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeMoveResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|queryAssets}. + * @param error Error, if any + * @param [response] QueryAssetsResponse + */ + type QueryAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1.QueryAssetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|createSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type CreateSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|getSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type GetSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|listSavedQueries}. + * @param error Error, if any + * @param [response] ListSavedQueriesResponse + */ + type ListSavedQueriesCallback = (error: (Error|null), response?: google.cloud.asset.v1.ListSavedQueriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|updateSavedQuery}. + * @param error Error, if any + * @param [response] SavedQuery + */ + type UpdateSavedQueryCallback = (error: (Error|null), response?: google.cloud.asset.v1.SavedQuery) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|deleteSavedQuery}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSavedQueryCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|batchGetEffectiveIamPolicies}. + * @param error Error, if any + * @param [response] BatchGetEffectiveIamPoliciesResponse + */ + type BatchGetEffectiveIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeOrgPolicies}. + * @param error Error, if any + * @param [response] AnalyzeOrgPoliciesResponse + */ + type AnalyzeOrgPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeOrgPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeOrgPolicyGovernedContainers}. + * @param error Error, if any + * @param [response] AnalyzeOrgPolicyGovernedContainersResponse + */ + type AnalyzeOrgPolicyGovernedContainersCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeOrgPolicyGovernedAssets}. + * @param error Error, if any + * @param [response] AnalyzeOrgPolicyGovernedAssetsResponse + */ + type AnalyzeOrgPolicyGovernedAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse) => void; + } + + /** Properties of an AnalyzeIamPolicyLongrunningMetadata. */ + interface IAnalyzeIamPolicyLongrunningMetadata { + + /** AnalyzeIamPolicyLongrunningMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AnalyzeIamPolicyLongrunningMetadata. */ + class AnalyzeIamPolicyLongrunningMetadata implements IAnalyzeIamPolicyLongrunningMetadata { + + /** + * Constructs a new AnalyzeIamPolicyLongrunningMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata); + + /** AnalyzeIamPolicyLongrunningMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new AnalyzeIamPolicyLongrunningMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyLongrunningMetadata instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningMetadata message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyLongrunningMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyLongrunningMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; + + /** + * Decodes an AnalyzeIamPolicyLongrunningMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyLongrunningMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; + + /** + * Verifies an AnalyzeIamPolicyLongrunningMetadata 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 AnalyzeIamPolicyLongrunningMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyLongrunningMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningMetadata message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyLongrunningMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyLongrunningMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { + + /** ExportAssetsRequest parent */ + parent?: (string|null); + + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** ExportAssetsRequest relationshipTypes */ + relationshipTypes?: (string[]|null); + } + + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { + + /** + * Constructs a new ExportAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IExportAssetsRequest); + + /** ExportAssetsRequest parent. */ + public parent: string; + + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** ExportAssetsRequest relationshipTypes. */ + public relationshipTypes: string[]; + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IExportAssetsRequest): google.cloud.asset.v1.ExportAssetsRequest; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsRequest; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsRequest; + + /** + * Verifies an ExportAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsRequest; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { + + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** ExportAssetsResponse outputResult */ + outputResult?: (google.cloud.asset.v1.IOutputResult|null); + } + + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { + + /** + * Constructs a new ExportAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IExportAssetsResponse); + + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** ExportAssetsResponse outputResult. */ + public outputResult?: (google.cloud.asset.v1.IOutputResult|null); + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IExportAssetsResponse): google.cloud.asset.v1.ExportAssetsResponse; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ExportAssetsResponse; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ExportAssetsResponse; + + /** + * Verifies an ExportAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ExportAssetsResponse; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ListAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + + /** ListAssetsRequest relationshipTypes */ + relationshipTypes?: (string[]|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ListAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** ListAssetsRequest relationshipTypes. */ + public relationshipTypes: string[]; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IListAssetsRequest): google.cloud.asset.v1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse assets */ + assets?: (google.cloud.asset.v1.IAsset[]|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListAssetsResponse); + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse assets. */ + public assets: google.cloud.asset.v1.IAsset[]; + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IListAssetsResponse): google.cloud.asset.v1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchGetAssetsHistoryRequest. */ + interface IBatchGetAssetsHistoryRequest { + + /** BatchGetAssetsHistoryRequest parent */ + parent?: (string|null); + + /** BatchGetAssetsHistoryRequest assetNames */ + assetNames?: (string[]|null); + + /** BatchGetAssetsHistoryRequest contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** BatchGetAssetsHistoryRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + + /** BatchGetAssetsHistoryRequest relationshipTypes */ + relationshipTypes?: (string[]|null); + } + + /** Represents a BatchGetAssetsHistoryRequest. */ + class BatchGetAssetsHistoryRequest implements IBatchGetAssetsHistoryRequest { + + /** + * Constructs a new BatchGetAssetsHistoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest); + + /** BatchGetAssetsHistoryRequest parent. */ + public parent: string; + + /** BatchGetAssetsHistoryRequest assetNames. */ + public assetNames: string[]; + + /** BatchGetAssetsHistoryRequest contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** BatchGetAssetsHistoryRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + + /** BatchGetAssetsHistoryRequest relationshipTypes. */ + public relationshipTypes: string[]; + + /** + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @param message BatchGetAssetsHistoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + + /** + * Verifies a BatchGetAssetsHistoryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryRequest; + + /** + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetAssetsHistoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { + + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1.ITemporalAsset[]|null); + } + + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse); + + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1.ITemporalAsset[]; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + + /** + * Verifies a BatchGetAssetsHistoryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetAssetsHistoryResponse; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetAssetsHistoryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { + + /** CreateFeedRequest parent */ + parent?: (string|null); + + /** CreateFeedRequest feedId */ + feedId?: (string|null); + + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); + } + + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { + + /** + * Constructs a new CreateFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ICreateFeedRequest); + + /** CreateFeedRequest parent. */ + public parent: string; + + /** CreateFeedRequest feedId. */ + public feedId: string; + + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); + + /** + * Creates a new CreateFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1.ICreateFeedRequest): google.cloud.asset.v1.CreateFeedRequest; + + /** + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateFeedRequest; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateFeedRequest; + + /** + * Verifies a CreateFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateFeedRequest; + + /** + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { + + /** GetFeedRequest name */ + name?: (string|null); + } + + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { + + /** + * Constructs a new GetFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IGetFeedRequest); + + /** GetFeedRequest name. */ + public name: string; + + /** + * Creates a new GetFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IGetFeedRequest): google.cloud.asset.v1.GetFeedRequest; + + /** + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetFeedRequest; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetFeedRequest; + + /** + * Verifies a GetFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetFeedRequest; + + /** + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { + + /** ListFeedsRequest parent */ + parent?: (string|null); + } + + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { + + /** + * Constructs a new ListFeedsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListFeedsRequest); + + /** ListFeedsRequest parent. */ + public parent: string; + + /** + * Creates a new ListFeedsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFeedsRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IListFeedsRequest): google.cloud.asset.v1.ListFeedsRequest; + + /** + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsRequest; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsRequest; + + /** + * Verifies a ListFeedsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFeedsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsRequest; + + /** + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFeedsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFeedsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { + + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1.IFeed[]|null); + } + + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { + + /** + * Constructs a new ListFeedsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListFeedsResponse); + + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1.IFeed[]; + + /** + * Creates a new ListFeedsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFeedsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IListFeedsResponse): google.cloud.asset.v1.ListFeedsResponse; + + /** + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListFeedsResponse; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListFeedsResponse; + + /** + * Verifies a ListFeedsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFeedsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListFeedsResponse; + + /** + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFeedsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFeedsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { + + /** UpdateFeedRequest feed */ + feed?: (google.cloud.asset.v1.IFeed|null); + + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { + + /** + * Constructs a new UpdateFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IUpdateFeedRequest); + + /** UpdateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1.IFeed|null); + + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IUpdateFeedRequest): google.cloud.asset.v1.UpdateFeedRequest; + + /** + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.UpdateFeedRequest; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.UpdateFeedRequest; + + /** + * Verifies an UpdateFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateFeedRequest; + + /** + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { + + /** DeleteFeedRequest name */ + name?: (string|null); + } + + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { + + /** + * Constructs a new DeleteFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IDeleteFeedRequest); + + /** DeleteFeedRequest name. */ + public name: string; + + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IDeleteFeedRequest): google.cloud.asset.v1.DeleteFeedRequest; + + /** + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.DeleteFeedRequest; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.DeleteFeedRequest; + + /** + * Verifies a DeleteFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteFeedRequest; + + /** + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1.IOutputConfig): google.cloud.asset.v1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputResult. */ + interface IOutputResult { + + /** OutputResult gcsResult */ + gcsResult?: (google.cloud.asset.v1.IGcsOutputResult|null); + } + + /** Represents an OutputResult. */ + class OutputResult implements IOutputResult { + + /** + * Constructs a new OutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IOutputResult); + + /** OutputResult gcsResult. */ + public gcsResult?: (google.cloud.asset.v1.IGcsOutputResult|null); + + /** OutputResult result. */ + public result?: "gcsResult"; + + /** + * Creates a new OutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputResult instance + */ + public static create(properties?: google.cloud.asset.v1.IOutputResult): google.cloud.asset.v1.OutputResult; + + /** + * Encodes the specified OutputResult message. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @param message OutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @param message OutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.OutputResult; + + /** + * Decodes an OutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.OutputResult; + + /** + * Verifies an OutputResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.OutputResult; + + /** + * Creates a plain object from an OutputResult message. Also converts values to other types if specified. + * @param message OutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.OutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsOutputResult. */ + interface IGcsOutputResult { + + /** GcsOutputResult uris */ + uris?: (string[]|null); + } + + /** Represents a GcsOutputResult. */ + class GcsOutputResult implements IGcsOutputResult { + + /** + * Constructs a new GcsOutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IGcsOutputResult); + + /** GcsOutputResult uris. */ + public uris: string[]; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsOutputResult instance + */ + public static create(properties?: google.cloud.asset.v1.IGcsOutputResult): google.cloud.asset.v1.GcsOutputResult; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GcsOutputResult; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GcsOutputResult; + + /** + * Verifies a GcsOutputResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsOutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GcsOutputResult; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @param message GcsOutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.GcsOutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsOutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsOutputResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IGcsDestination); + + /** GcsDestination uri. */ + public uri?: (string|null); + + /** GcsDestination uriPrefix. */ + public uriPrefix?: (string|null); + + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IGcsDestination): google.cloud.asset.v1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination table */ + table?: (string|null); + + /** BigQueryDestination force */ + force?: (boolean|null); + + /** BigQueryDestination partitionSpec */ + partitionSpec?: (google.cloud.asset.v1.IPartitionSpec|null); + + /** BigQueryDestination separateTablesPerAssetType */ + separateTablesPerAssetType?: (boolean|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination table. */ + public table: string; + + /** BigQueryDestination force. */ + public force: boolean; + + /** BigQueryDestination partitionSpec. */ + public partitionSpec?: (google.cloud.asset.v1.IPartitionSpec|null); + + /** BigQueryDestination separateTablesPerAssetType. */ + public separateTablesPerAssetType: boolean; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IBigQueryDestination): google.cloud.asset.v1.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BigQueryDestination; + + /** + * Verifies a BigQueryDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionSpec. */ + interface IPartitionSpec { + + /** PartitionSpec partitionKey */ + partitionKey?: (google.cloud.asset.v1.PartitionSpec.PartitionKey|keyof typeof google.cloud.asset.v1.PartitionSpec.PartitionKey|null); + } + + /** Represents a PartitionSpec. */ + class PartitionSpec implements IPartitionSpec { + + /** + * Constructs a new PartitionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IPartitionSpec); + + /** PartitionSpec partitionKey. */ + public partitionKey: (google.cloud.asset.v1.PartitionSpec.PartitionKey|keyof typeof google.cloud.asset.v1.PartitionSpec.PartitionKey); + + /** + * Creates a new PartitionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionSpec instance + */ + public static create(properties?: google.cloud.asset.v1.IPartitionSpec): google.cloud.asset.v1.PartitionSpec; + + /** + * Encodes the specified PartitionSpec message. Does not implicitly {@link google.cloud.asset.v1.PartitionSpec.verify|verify} messages. + * @param message PartitionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IPartitionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionSpec message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PartitionSpec.verify|verify} messages. + * @param message PartitionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IPartitionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.PartitionSpec; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.PartitionSpec; + + /** + * Verifies a PartitionSpec 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 PartitionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PartitionSpec; + + /** + * Creates a plain object from a PartitionSpec message. Also converts values to other types if specified. + * @param message PartitionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.PartitionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PartitionSpec { + + /** PartitionKey enum. */ + enum PartitionKey { + PARTITION_KEY_UNSPECIFIED = 0, + READ_TIME = 1, + REQUEST_TIME = 2 + } + } + + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { + + /** PubsubDestination topic */ + topic?: (string|null); + } + + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { + + /** + * Constructs a new PubsubDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IPubsubDestination); + + /** PubsubDestination topic. */ + public topic: string; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IPubsubDestination): google.cloud.asset.v1.PubsubDestination; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.PubsubDestination; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.PubsubDestination; + + /** + * Verifies a PubsubDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.PubsubDestination; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { + + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + } + + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { + + /** + * Constructs a new FeedOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IFeedOutputConfig); + + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1.IPubsubDestination|null); + + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FeedOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1.IFeedOutputConfig): google.cloud.asset.v1.FeedOutputConfig; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.FeedOutputConfig; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.FeedOutputConfig; + + /** + * Verifies a FeedOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeedOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.FeedOutputConfig; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeedOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeedOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Feed. */ + interface IFeed { + + /** Feed name */ + name?: (string|null); + + /** Feed assetNames */ + assetNames?: (string[]|null); + + /** Feed assetTypes */ + assetTypes?: (string[]|null); + + /** Feed contentType */ + contentType?: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType|null); + + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + + /** Feed condition */ + condition?: (google.type.IExpr|null); + + /** Feed relationshipTypes */ + relationshipTypes?: (string[]|null); + } + + /** Represents a Feed. */ + class Feed implements IFeed { + + /** + * Constructs a new Feed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IFeed); + + /** Feed name. */ + public name: string; + + /** Feed assetNames. */ + public assetNames: string[]; + + /** Feed assetTypes. */ + public assetTypes: string[]; + + /** Feed contentType. */ + public contentType: (google.cloud.asset.v1.ContentType|keyof typeof google.cloud.asset.v1.ContentType); + + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1.IFeedOutputConfig|null); + + /** Feed condition. */ + public condition?: (google.type.IExpr|null); + + /** Feed relationshipTypes. */ + public relationshipTypes: string[]; + + /** + * Creates a new Feed instance using the specified properties. + * @param [properties] Properties to set + * @returns Feed instance + */ + public static create(properties?: google.cloud.asset.v1.IFeed): google.cloud.asset.v1.Feed; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Feed; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Feed; + + /** + * Verifies a Feed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Feed; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Feed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllResourcesRequest. */ + interface ISearchAllResourcesRequest { + + /** SearchAllResourcesRequest scope */ + scope?: (string|null); + + /** SearchAllResourcesRequest query */ + query?: (string|null); + + /** SearchAllResourcesRequest assetTypes */ + assetTypes?: (string[]|null); + + /** SearchAllResourcesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllResourcesRequest pageToken */ + pageToken?: (string|null); + + /** SearchAllResourcesRequest orderBy */ + orderBy?: (string|null); + + /** SearchAllResourcesRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SearchAllResourcesRequest. */ + class SearchAllResourcesRequest implements ISearchAllResourcesRequest { + + /** + * Constructs a new SearchAllResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ISearchAllResourcesRequest); + + /** SearchAllResourcesRequest scope. */ + public scope: string; + + /** SearchAllResourcesRequest query. */ + public query: string; + + /** SearchAllResourcesRequest assetTypes. */ + public assetTypes: string[]; + + /** SearchAllResourcesRequest pageSize. */ + public pageSize: number; + + /** SearchAllResourcesRequest pageToken. */ + public pageToken: string; + + /** SearchAllResourcesRequest orderBy. */ + public orderBy: string; + + /** SearchAllResourcesRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SearchAllResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllResourcesRequest instance + */ + public static create(properties?: google.cloud.asset.v1.ISearchAllResourcesRequest): google.cloud.asset.v1.SearchAllResourcesRequest; + + /** + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SearchAllResourcesRequest; + + /** + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SearchAllResourcesRequest; + + /** + * Verifies a SearchAllResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SearchAllResourcesRequest; + + /** + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. + * @param message SearchAllResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SearchAllResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllResourcesResponse. */ + interface ISearchAllResourcesResponse { + + /** SearchAllResourcesResponse results */ + results?: (google.cloud.asset.v1.IResourceSearchResult[]|null); + + /** SearchAllResourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAllResourcesResponse. */ + class SearchAllResourcesResponse implements ISearchAllResourcesResponse { + + /** + * Constructs a new SearchAllResourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ISearchAllResourcesResponse); + + /** SearchAllResourcesResponse results. */ + public results: google.cloud.asset.v1.IResourceSearchResult[]; + + /** SearchAllResourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAllResourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllResourcesResponse instance + */ + public static create(properties?: google.cloud.asset.v1.ISearchAllResourcesResponse): google.cloud.asset.v1.SearchAllResourcesResponse; + + /** + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SearchAllResourcesResponse; + + /** + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SearchAllResourcesResponse; + + /** + * Verifies a SearchAllResourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllResourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SearchAllResourcesResponse; + + /** + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. + * @param message SearchAllResourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SearchAllResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllResourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllIamPoliciesRequest. */ + interface ISearchAllIamPoliciesRequest { + + /** SearchAllIamPoliciesRequest scope */ + scope?: (string|null); + + /** SearchAllIamPoliciesRequest query */ + query?: (string|null); + + /** SearchAllIamPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllIamPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** SearchAllIamPoliciesRequest assetTypes */ + assetTypes?: (string[]|null); + + /** SearchAllIamPoliciesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a SearchAllIamPoliciesRequest. */ + class SearchAllIamPoliciesRequest implements ISearchAllIamPoliciesRequest { + + /** + * Constructs a new SearchAllIamPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ISearchAllIamPoliciesRequest); + + /** SearchAllIamPoliciesRequest scope. */ + public scope: string; + + /** SearchAllIamPoliciesRequest query. */ + public query: string; + + /** SearchAllIamPoliciesRequest pageSize. */ + public pageSize: number; + + /** SearchAllIamPoliciesRequest pageToken. */ + public pageToken: string; + + /** SearchAllIamPoliciesRequest assetTypes. */ + public assetTypes: string[]; + + /** SearchAllIamPoliciesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllIamPoliciesRequest instance + */ + public static create(properties?: google.cloud.asset.v1.ISearchAllIamPoliciesRequest): google.cloud.asset.v1.SearchAllIamPoliciesRequest; + + /** + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SearchAllIamPoliciesRequest; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SearchAllIamPoliciesRequest; + + /** + * Verifies a SearchAllIamPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllIamPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SearchAllIamPoliciesRequest; + + /** + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SearchAllIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllIamPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllIamPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllIamPoliciesResponse. */ + interface ISearchAllIamPoliciesResponse { + + /** SearchAllIamPoliciesResponse results */ + results?: (google.cloud.asset.v1.IIamPolicySearchResult[]|null); + + /** SearchAllIamPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAllIamPoliciesResponse. */ + class SearchAllIamPoliciesResponse implements ISearchAllIamPoliciesResponse { + + /** + * Constructs a new SearchAllIamPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ISearchAllIamPoliciesResponse); + + /** SearchAllIamPoliciesResponse results. */ + public results: google.cloud.asset.v1.IIamPolicySearchResult[]; + + /** SearchAllIamPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllIamPoliciesResponse instance + */ + public static create(properties?: google.cloud.asset.v1.ISearchAllIamPoliciesResponse): google.cloud.asset.v1.SearchAllIamPoliciesResponse; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SearchAllIamPoliciesResponse; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SearchAllIamPoliciesResponse; + + /** + * Verifies a SearchAllIamPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllIamPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SearchAllIamPoliciesResponse; + + /** + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SearchAllIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllIamPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllIamPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IamPolicyAnalysisQuery. */ + interface IIamPolicyAnalysisQuery { + + /** IamPolicyAnalysisQuery scope */ + scope?: (string|null); + + /** IamPolicyAnalysisQuery resourceSelector */ + resourceSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null); + + /** IamPolicyAnalysisQuery identitySelector */ + identitySelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null); + + /** IamPolicyAnalysisQuery accessSelector */ + accessSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null); + + /** IamPolicyAnalysisQuery options */ + options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); + + /** IamPolicyAnalysisQuery conditionContext */ + conditionContext?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext|null); + } + + /** Represents an IamPolicyAnalysisQuery. */ + class IamPolicyAnalysisQuery implements IIamPolicyAnalysisQuery { + + /** + * Constructs a new IamPolicyAnalysisQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisQuery); + + /** IamPolicyAnalysisQuery scope. */ + public scope: string; + + /** IamPolicyAnalysisQuery resourceSelector. */ + public resourceSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null); + + /** IamPolicyAnalysisQuery identitySelector. */ + public identitySelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null); + + /** IamPolicyAnalysisQuery accessSelector. */ + public accessSelector?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null); + + /** IamPolicyAnalysisQuery options. */ + public options?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null); + + /** IamPolicyAnalysisQuery conditionContext. */ + public conditionContext?: (google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext|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.v1.IIamPolicyAnalysisQuery): google.cloud.asset.v1.IamPolicyAnalysisQuery; + + /** + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IIamPolicyAnalysisQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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.v1.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.v1.IamPolicyAnalysisQuery.IResourceSelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector; + + /** + * Encodes the specified ResourceSelector message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.IResourceSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisQuery.ResourceSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v1.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.v1.IamPolicyAnalysisQuery.IIdentitySelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector; + + /** + * Encodes the specified IdentitySelector message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.IIdentitySelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentitySelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisQuery.IdentitySelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentitySelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentitySelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v1.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.v1.IamPolicyAnalysisQuery.IAccessSelector): google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector; + + /** + * Encodes the specified AccessSelector message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.IAccessSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessSelector message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisQuery.AccessSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.IOptions): google.cloud.asset.v1.IamPolicyAnalysisQuery.Options; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.IOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Options message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.Options, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Options to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Options + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConditionContext. */ + interface IConditionContext { + + /** ConditionContext accessTime */ + accessTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ConditionContext. */ + class ConditionContext implements IConditionContext { + + /** + * Constructs a new ConditionContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext); + + /** ConditionContext accessTime. */ + public accessTime?: (google.protobuf.ITimestamp|null); + + /** ConditionContext TimeContext. */ + public TimeContext?: "accessTime"; + + /** + * Creates a new ConditionContext instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionContext instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext): google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext; + + /** + * Encodes the specified ConditionContext message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify|verify} messages. + * @param message ConditionContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionContext message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify|verify} messages. + * @param message ConditionContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext; + + /** + * Decodes a ConditionContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext; + + /** + * Verifies a ConditionContext 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 ConditionContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext; + + /** + * Creates a plain object from a ConditionContext message. Also converts values to other types if specified. + * @param message ConditionContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionContext + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AnalyzeIamPolicyRequest. */ + interface IAnalyzeIamPolicyRequest { + + /** AnalyzeIamPolicyRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest savedAnalysisQuery */ + savedAnalysisQuery?: (string|null); + + /** AnalyzeIamPolicyRequest executionTimeout */ + executionTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents an AnalyzeIamPolicyRequest. */ + class AnalyzeIamPolicyRequest implements IAnalyzeIamPolicyRequest { + + /** + * Constructs a new AnalyzeIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyRequest); + + /** AnalyzeIamPolicyRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyRequest savedAnalysisQuery. */ + public savedAnalysisQuery: string; + + /** AnalyzeIamPolicyRequest executionTimeout. */ + public executionTimeout?: (google.protobuf.IDuration|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.v1.IAnalyzeIamPolicyRequest): google.cloud.asset.v1.AnalyzeIamPolicyRequest; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IAnalyzeIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.AnalyzeIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeIamPolicyResponse. */ + interface IAnalyzeIamPolicyResponse { + + /** AnalyzeIamPolicyResponse mainAnalysis */ + mainAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); + + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis */ + serviceAccountImpersonationAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]|null); + + /** AnalyzeIamPolicyResponse fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an AnalyzeIamPolicyResponse. */ + class AnalyzeIamPolicyResponse implements IAnalyzeIamPolicyResponse { + + /** + * Constructs a new AnalyzeIamPolicyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyResponse); + + /** AnalyzeIamPolicyResponse mainAnalysis. */ + public mainAnalysis?: (google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null); + + /** AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. */ + public serviceAccountImpersonationAnalysis: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis[]; + + /** AnalyzeIamPolicyResponse fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyResponse): google.cloud.asset.v1.AnalyzeIamPolicyResponse; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IAnalyzeIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.AnalyzeIamPolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnalyzeIamPolicyResponse { + + /** Properties of an IamPolicyAnalysis. */ + interface IIamPolicyAnalysis { + + /** IamPolicyAnalysis analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** IamPolicyAnalysis analysisResults */ + analysisResults?: (google.cloud.asset.v1.IIamPolicyAnalysisResult[]|null); + + /** IamPolicyAnalysis fullyExplored */ + fullyExplored?: (boolean|null); + + /** IamPolicyAnalysis nonCriticalErrors */ + nonCriticalErrors?: (google.cloud.asset.v1.IIamPolicyAnalysisState[]|null); + } + + /** Represents an IamPolicyAnalysis. */ + class IamPolicyAnalysis implements IIamPolicyAnalysis { + + /** + * Constructs a new IamPolicyAnalysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis); + + /** IamPolicyAnalysis analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** IamPolicyAnalysis analysisResults. */ + public analysisResults: google.cloud.asset.v1.IIamPolicyAnalysisResult[]; + + /** IamPolicyAnalysis fullyExplored. */ + public fullyExplored: boolean; + + /** IamPolicyAnalysis nonCriticalErrors. */ + public nonCriticalErrors: google.cloud.asset.v1.IIamPolicyAnalysisState[]; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysis instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis): google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis; + + /** + * Encodes the specified IamPolicyAnalysis message. Does not implicitly {@link google.cloud.asset.v1.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.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an IamPolicyAnalysisOutputConfig. */ + interface IIamPolicyAnalysisOutputConfig { + + /** IamPolicyAnalysisOutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); + + /** IamPolicyAnalysisOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null); + } + + /** Represents an IamPolicyAnalysisOutputConfig. */ + class IamPolicyAnalysisOutputConfig implements IIamPolicyAnalysisOutputConfig { + + /** + * Constructs a new IamPolicyAnalysisOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig); + + /** IamPolicyAnalysisOutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null); + + /** IamPolicyAnalysisOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null); + + /** IamPolicyAnalysisOutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IIamPolicyAnalysisOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + 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.v1.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.v1.IamPolicyAnalysisOutputConfig.IGcsDestination): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisOutputConfig.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination tablePrefix */ + tablePrefix?: (string|null); + + /** BigQueryDestination partitionKey */ + partitionKey?: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|null); + + /** BigQueryDestination writeDisposition */ + writeDisposition?: (string|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination tablePrefix. */ + public tablePrefix: string; + + /** BigQueryDestination partitionKey. */ + public partitionKey: (google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|keyof typeof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey); + + /** BigQueryDestination writeDisposition. */ + public writeDisposition: string; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Verifies a BigQueryDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BigQueryDestination { + + /** PartitionKey enum. */ + enum PartitionKey { + PARTITION_KEY_UNSPECIFIED = 0, + REQUEST_TIME = 1 + } + } + } + + /** Properties of an AnalyzeIamPolicyLongrunningRequest. */ + interface IAnalyzeIamPolicyLongrunningRequest { + + /** AnalyzeIamPolicyLongrunningRequest analysisQuery */ + analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery */ + savedAnalysisQuery?: (string|null); + + /** AnalyzeIamPolicyLongrunningRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); + } + + /** Represents an AnalyzeIamPolicyLongrunningRequest. */ + class AnalyzeIamPolicyLongrunningRequest implements IAnalyzeIamPolicyLongrunningRequest { + + /** + * Constructs a new AnalyzeIamPolicyLongrunningRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest); + + /** AnalyzeIamPolicyLongrunningRequest analysisQuery. */ + public analysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery. */ + public savedAnalysisQuery: string; + + /** AnalyzeIamPolicyLongrunningRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null); + + /** + * Creates a new AnalyzeIamPolicyLongrunningRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyLongrunningRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyLongrunningRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyLongrunningRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; + + /** + * Decodes an AnalyzeIamPolicyLongrunningRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyLongrunningRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; + + /** + * Verifies an AnalyzeIamPolicyLongrunningRequest 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 AnalyzeIamPolicyLongrunningRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyLongrunningRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningRequest message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyLongrunningRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyLongrunningRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeIamPolicyLongrunningResponse. */ + interface IAnalyzeIamPolicyLongrunningResponse { + } + + /** Represents an AnalyzeIamPolicyLongrunningResponse. */ + class AnalyzeIamPolicyLongrunningResponse implements IAnalyzeIamPolicyLongrunningResponse { + + /** + * Constructs a new AnalyzeIamPolicyLongrunningResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse); + + /** + * Creates a new AnalyzeIamPolicyLongrunningResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeIamPolicyLongrunningResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse.verify|verify} messages. + * @param message AnalyzeIamPolicyLongrunningResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeIamPolicyLongrunningResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeIamPolicyLongrunningResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; + + /** + * Decodes an AnalyzeIamPolicyLongrunningResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeIamPolicyLongrunningResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; + + /** + * Verifies an AnalyzeIamPolicyLongrunningResponse 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 AnalyzeIamPolicyLongrunningResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeIamPolicyLongrunningResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningResponse message. Also converts values to other types if specified. + * @param message AnalyzeIamPolicyLongrunningResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeIamPolicyLongrunningResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SavedQuery. */ + interface ISavedQuery { + + /** SavedQuery name */ + name?: (string|null); + + /** SavedQuery description */ + description?: (string|null); + + /** SavedQuery createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery creator */ + creator?: (string|null); + + /** SavedQuery lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery lastUpdater */ + lastUpdater?: (string|null); + + /** SavedQuery labels */ + labels?: ({ [k: string]: string }|null); + + /** SavedQuery content */ + content?: (google.cloud.asset.v1.SavedQuery.IQueryContent|null); + } + + /** Represents a SavedQuery. */ + class SavedQuery implements ISavedQuery { + + /** + * Constructs a new SavedQuery. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ISavedQuery); + + /** SavedQuery name. */ + public name: string; + + /** SavedQuery description. */ + public description: string; + + /** SavedQuery createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery creator. */ + public creator: string; + + /** SavedQuery lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** SavedQuery lastUpdater. */ + public lastUpdater: string; + + /** SavedQuery labels. */ + public labels: { [k: string]: string }; + + /** SavedQuery content. */ + public content?: (google.cloud.asset.v1.SavedQuery.IQueryContent|null); + + /** + * Creates a new SavedQuery instance using the specified properties. + * @param [properties] Properties to set + * @returns SavedQuery instance + */ + public static create(properties?: google.cloud.asset.v1.ISavedQuery): google.cloud.asset.v1.SavedQuery; + + /** + * Encodes the specified SavedQuery message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. + * @param message SavedQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ISavedQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SavedQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. + * @param message SavedQuery message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ISavedQuery, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SavedQuery message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SavedQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SavedQuery; + + /** + * Decodes a SavedQuery message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SavedQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SavedQuery; + + /** + * Verifies a SavedQuery message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SavedQuery message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SavedQuery + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SavedQuery; + + /** + * Creates a plain object from a SavedQuery message. Also converts values to other types if specified. + * @param message SavedQuery + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SavedQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SavedQuery to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SavedQuery + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SavedQuery { + + /** Properties of a QueryContent. */ + interface IQueryContent { + + /** QueryContent iamPolicyAnalysisQuery */ + iamPolicyAnalysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + } + + /** Represents a QueryContent. */ + class QueryContent implements IQueryContent { + + /** + * Constructs a new QueryContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.SavedQuery.IQueryContent); + + /** QueryContent iamPolicyAnalysisQuery. */ + public iamPolicyAnalysisQuery?: (google.cloud.asset.v1.IIamPolicyAnalysisQuery|null); + + /** QueryContent queryContent. */ + public queryContent?: "iamPolicyAnalysisQuery"; + + /** + * Creates a new QueryContent instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryContent instance + */ + public static create(properties?: google.cloud.asset.v1.SavedQuery.IQueryContent): google.cloud.asset.v1.SavedQuery.QueryContent; + + /** + * Encodes the specified QueryContent message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @param message QueryContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.SavedQuery.IQueryContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryContent message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @param message QueryContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.SavedQuery.IQueryContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.SavedQuery.QueryContent; + + /** + * Decodes a QueryContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.SavedQuery.QueryContent; + + /** + * Verifies a QueryContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.SavedQuery.QueryContent; + + /** + * Creates a plain object from a QueryContent message. Also converts values to other types if specified. + * @param message QueryContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.SavedQuery.QueryContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateSavedQueryRequest. */ + interface ICreateSavedQueryRequest { + + /** CreateSavedQueryRequest parent */ + parent?: (string|null); + + /** CreateSavedQueryRequest savedQuery */ + savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); + + /** CreateSavedQueryRequest savedQueryId */ + savedQueryId?: (string|null); + } + + /** Represents a CreateSavedQueryRequest. */ + class CreateSavedQueryRequest implements ICreateSavedQueryRequest { + + /** + * Constructs a new CreateSavedQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ICreateSavedQueryRequest); + + /** CreateSavedQueryRequest parent. */ + public parent: string; + + /** CreateSavedQueryRequest savedQuery. */ + public savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); + + /** CreateSavedQueryRequest savedQueryId. */ + public savedQueryId: string; + + /** + * Creates a new CreateSavedQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSavedQueryRequest instance + */ + public static create(properties?: google.cloud.asset.v1.ICreateSavedQueryRequest): google.cloud.asset.v1.CreateSavedQueryRequest; + + /** + * Encodes the specified CreateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @param message CreateSavedQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ICreateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @param message CreateSavedQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ICreateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.CreateSavedQueryRequest; + + /** + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.CreateSavedQueryRequest; + + /** + * Verifies a CreateSavedQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSavedQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.CreateSavedQueryRequest; + + /** + * Creates a plain object from a CreateSavedQueryRequest message. Also converts values to other types if specified. + * @param message CreateSavedQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.CreateSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSavedQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSavedQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSavedQueryRequest. */ + interface IGetSavedQueryRequest { + + /** GetSavedQueryRequest name */ + name?: (string|null); + } + + /** Represents a GetSavedQueryRequest. */ + class GetSavedQueryRequest implements IGetSavedQueryRequest { + + /** + * Constructs a new GetSavedQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IGetSavedQueryRequest); + + /** GetSavedQueryRequest name. */ + public name: string; + + /** + * Creates a new GetSavedQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSavedQueryRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IGetSavedQueryRequest): google.cloud.asset.v1.GetSavedQueryRequest; + + /** + * Encodes the specified GetSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @param message GetSavedQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IGetSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @param message GetSavedQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IGetSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSavedQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.GetSavedQueryRequest; + + /** + * Decodes a GetSavedQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.GetSavedQueryRequest; + + /** + * Verifies a GetSavedQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSavedQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.GetSavedQueryRequest; + + /** + * Creates a plain object from a GetSavedQueryRequest message. Also converts values to other types if specified. + * @param message GetSavedQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.GetSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSavedQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSavedQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSavedQueriesRequest. */ + interface IListSavedQueriesRequest { + + /** ListSavedQueriesRequest parent */ + parent?: (string|null); + + /** ListSavedQueriesRequest filter */ + filter?: (string|null); + + /** ListSavedQueriesRequest pageSize */ + pageSize?: (number|null); + + /** ListSavedQueriesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSavedQueriesRequest. */ + class ListSavedQueriesRequest implements IListSavedQueriesRequest { + + /** + * Constructs a new ListSavedQueriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListSavedQueriesRequest); + + /** ListSavedQueriesRequest parent. */ + public parent: string; + + /** ListSavedQueriesRequest filter. */ + public filter: string; + + /** ListSavedQueriesRequest pageSize. */ + public pageSize: number; + + /** ListSavedQueriesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSavedQueriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSavedQueriesRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IListSavedQueriesRequest): google.cloud.asset.v1.ListSavedQueriesRequest; + + /** + * Encodes the specified ListSavedQueriesRequest message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @param message ListSavedQueriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListSavedQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSavedQueriesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @param message ListSavedQueriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListSavedQueriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSavedQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListSavedQueriesRequest; + + /** + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSavedQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListSavedQueriesRequest; + + /** + * Verifies a ListSavedQueriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSavedQueriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSavedQueriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListSavedQueriesRequest; + + /** + * Creates a plain object from a ListSavedQueriesRequest message. Also converts values to other types if specified. + * @param message ListSavedQueriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListSavedQueriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSavedQueriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSavedQueriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSavedQueriesResponse. */ + interface IListSavedQueriesResponse { + + /** ListSavedQueriesResponse savedQueries */ + savedQueries?: (google.cloud.asset.v1.ISavedQuery[]|null); + + /** ListSavedQueriesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSavedQueriesResponse. */ + class ListSavedQueriesResponse implements IListSavedQueriesResponse { + + /** + * Constructs a new ListSavedQueriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IListSavedQueriesResponse); + + /** ListSavedQueriesResponse savedQueries. */ + public savedQueries: google.cloud.asset.v1.ISavedQuery[]; + + /** ListSavedQueriesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSavedQueriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSavedQueriesResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IListSavedQueriesResponse): google.cloud.asset.v1.ListSavedQueriesResponse; + + /** + * Encodes the specified ListSavedQueriesResponse message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @param message ListSavedQueriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IListSavedQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSavedQueriesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @param message ListSavedQueriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IListSavedQueriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSavedQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ListSavedQueriesResponse; + + /** + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSavedQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ListSavedQueriesResponse; + + /** + * Verifies a ListSavedQueriesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSavedQueriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSavedQueriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ListSavedQueriesResponse; + + /** + * Creates a plain object from a ListSavedQueriesResponse message. Also converts values to other types if specified. + * @param message ListSavedQueriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ListSavedQueriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSavedQueriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSavedQueriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSavedQueryRequest. */ + interface IUpdateSavedQueryRequest { + + /** UpdateSavedQueryRequest savedQuery */ + savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); + + /** UpdateSavedQueryRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSavedQueryRequest. */ + class UpdateSavedQueryRequest implements IUpdateSavedQueryRequest { + + /** + * Constructs a new UpdateSavedQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IUpdateSavedQueryRequest); + + /** UpdateSavedQueryRequest savedQuery. */ + public savedQuery?: (google.cloud.asset.v1.ISavedQuery|null); + + /** UpdateSavedQueryRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSavedQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSavedQueryRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IUpdateSavedQueryRequest): google.cloud.asset.v1.UpdateSavedQueryRequest; + + /** + * Encodes the specified UpdateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @param message UpdateSavedQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IUpdateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @param message UpdateSavedQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IUpdateSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.UpdateSavedQueryRequest; + + /** + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.UpdateSavedQueryRequest; + + /** + * Verifies an UpdateSavedQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSavedQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.UpdateSavedQueryRequest; + + /** + * Creates a plain object from an UpdateSavedQueryRequest message. Also converts values to other types if specified. + * @param message UpdateSavedQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.UpdateSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSavedQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSavedQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSavedQueryRequest. */ + interface IDeleteSavedQueryRequest { + + /** DeleteSavedQueryRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSavedQueryRequest. */ + class DeleteSavedQueryRequest implements IDeleteSavedQueryRequest { + + /** + * Constructs a new DeleteSavedQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IDeleteSavedQueryRequest); + + /** DeleteSavedQueryRequest name. */ + public name: string; + + /** + * Creates a new DeleteSavedQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSavedQueryRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IDeleteSavedQueryRequest): google.cloud.asset.v1.DeleteSavedQueryRequest; + + /** + * Encodes the specified DeleteSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @param message DeleteSavedQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IDeleteSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @param message DeleteSavedQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IDeleteSavedQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.DeleteSavedQueryRequest; + + /** + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.DeleteSavedQueryRequest; + + /** + * Verifies a DeleteSavedQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSavedQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.DeleteSavedQueryRequest; + + /** + * Creates a plain object from a DeleteSavedQueryRequest message. Also converts values to other types if specified. + * @param message DeleteSavedQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.DeleteSavedQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSavedQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSavedQueryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeMoveRequest. */ + interface IAnalyzeMoveRequest { + + /** AnalyzeMoveRequest resource */ + resource?: (string|null); + + /** AnalyzeMoveRequest destinationParent */ + destinationParent?: (string|null); + + /** AnalyzeMoveRequest view */ + view?: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null); + } + + /** Represents an AnalyzeMoveRequest. */ + class AnalyzeMoveRequest implements IAnalyzeMoveRequest { + + /** + * Constructs a new AnalyzeMoveRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest); + + /** AnalyzeMoveRequest resource. */ + public resource: string; + + /** AnalyzeMoveRequest destinationParent. */ + public destinationParent: string; + + /** AnalyzeMoveRequest view. */ + public view: (google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|keyof typeof google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView); + + /** + * Creates a new AnalyzeMoveRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeMoveRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveRequest): google.cloud.asset.v1.AnalyzeMoveRequest; + + /** + * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @param message AnalyzeMoveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @param message AnalyzeMoveRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeMoveRequest; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeMoveRequest; + + /** + * Verifies an AnalyzeMoveRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeMoveRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveRequest; + + /** + * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * @param message AnalyzeMoveRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeMoveRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeMoveRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeMoveRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnalyzeMoveRequest { + + /** AnalysisView enum. */ + enum AnalysisView { + ANALYSIS_VIEW_UNSPECIFIED = 0, + FULL = 1, + BASIC = 2 + } + } + + /** Properties of an AnalyzeMoveResponse. */ + interface IAnalyzeMoveResponse { + + /** AnalyzeMoveResponse moveAnalysis */ + moveAnalysis?: (google.cloud.asset.v1.IMoveAnalysis[]|null); + } + + /** Represents an AnalyzeMoveResponse. */ + class AnalyzeMoveResponse implements IAnalyzeMoveResponse { + + /** + * Constructs a new AnalyzeMoveResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse); + + /** AnalyzeMoveResponse moveAnalysis. */ + public moveAnalysis: google.cloud.asset.v1.IMoveAnalysis[]; + + /** + * Creates a new AnalyzeMoveResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeMoveResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeMoveResponse): google.cloud.asset.v1.AnalyzeMoveResponse; + + /** + * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @param message AnalyzeMoveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @param message AnalyzeMoveResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeMoveResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeMoveResponse; + + /** + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeMoveResponse; + + /** + * Verifies an AnalyzeMoveResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnalyzeMoveResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeMoveResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeMoveResponse; + + /** + * Creates a plain object from an AnalyzeMoveResponse message. Also converts values to other types if specified. + * @param message AnalyzeMoveResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeMoveResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeMoveResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeMoveResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveAnalysis. */ + interface IMoveAnalysis { + + /** MoveAnalysis displayName */ + displayName?: (string|null); + + /** MoveAnalysis analysis */ + analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); + + /** MoveAnalysis error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a MoveAnalysis. */ + class MoveAnalysis implements IMoveAnalysis { + + /** + * Constructs a new MoveAnalysis. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IMoveAnalysis); + + /** MoveAnalysis displayName. */ + public displayName: string; + + /** MoveAnalysis analysis. */ + public analysis?: (google.cloud.asset.v1.IMoveAnalysisResult|null); + + /** MoveAnalysis error. */ + public error?: (google.rpc.IStatus|null); + + /** MoveAnalysis result. */ + public result?: ("analysis"|"error"); + + /** + * Creates a new MoveAnalysis instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveAnalysis instance + */ + public static create(properties?: google.cloud.asset.v1.IMoveAnalysis): google.cloud.asset.v1.MoveAnalysis; + + /** + * Encodes the specified MoveAnalysis message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @param message MoveAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @param message MoveAnalysis message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysis, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveAnalysis message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveAnalysis; + + /** + * Decodes a MoveAnalysis message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveAnalysis; + + /** + * Verifies a MoveAnalysis message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveAnalysis message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveAnalysis + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysis; + + /** + * Creates a plain object from a MoveAnalysis message. Also converts values to other types if specified. + * @param message MoveAnalysis + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.MoveAnalysis, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveAnalysis to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveAnalysis + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveAnalysisResult. */ + interface IMoveAnalysisResult { + + /** MoveAnalysisResult blockers */ + blockers?: (google.cloud.asset.v1.IMoveImpact[]|null); + + /** MoveAnalysisResult warnings */ + warnings?: (google.cloud.asset.v1.IMoveImpact[]|null); + } + + /** Represents a MoveAnalysisResult. */ + class MoveAnalysisResult implements IMoveAnalysisResult { + + /** + * Constructs a new MoveAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IMoveAnalysisResult); + + /** MoveAnalysisResult blockers. */ + public blockers: google.cloud.asset.v1.IMoveImpact[]; + + /** MoveAnalysisResult warnings. */ + public warnings: google.cloud.asset.v1.IMoveImpact[]; + + /** + * Creates a new MoveAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveAnalysisResult instance + */ + public static create(properties?: google.cloud.asset.v1.IMoveAnalysisResult): google.cloud.asset.v1.MoveAnalysisResult; + + /** + * Encodes the specified MoveAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @param message MoveAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @param message MoveAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IMoveAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveAnalysisResult; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveAnalysisResult; + + /** + * Verifies a MoveAnalysisResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveAnalysisResult; + + /** + * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * @param message MoveAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.MoveAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MoveImpact. */ + interface IMoveImpact { + + /** MoveImpact detail */ + detail?: (string|null); + } + + /** Represents a MoveImpact. */ + class MoveImpact implements IMoveImpact { + + /** + * Constructs a new MoveImpact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IMoveImpact); + + /** MoveImpact detail. */ + public detail: string; + + /** + * Creates a new MoveImpact instance using the specified properties. + * @param [properties] Properties to set + * @returns MoveImpact instance + */ + public static create(properties?: google.cloud.asset.v1.IMoveImpact): google.cloud.asset.v1.MoveImpact; + + /** + * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @param message MoveImpact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @param message MoveImpact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IMoveImpact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MoveImpact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.MoveImpact; + + /** + * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.MoveImpact; + + /** + * Verifies a MoveImpact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MoveImpact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.MoveImpact; + + /** + * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * @param message MoveImpact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.MoveImpact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MoveImpact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MoveImpact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryAssetsOutputConfig. */ + interface IQueryAssetsOutputConfig { + + /** QueryAssetsOutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination|null); + } + + /** Represents a QueryAssetsOutputConfig. */ + class QueryAssetsOutputConfig implements IQueryAssetsOutputConfig { + + /** + * Constructs a new QueryAssetsOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IQueryAssetsOutputConfig); + + /** QueryAssetsOutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination|null); + + /** + * Creates a new QueryAssetsOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryAssetsOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1.IQueryAssetsOutputConfig): google.cloud.asset.v1.QueryAssetsOutputConfig; + + /** + * Encodes the specified QueryAssetsOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.verify|verify} messages. + * @param message QueryAssetsOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IQueryAssetsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryAssetsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.verify|verify} messages. + * @param message QueryAssetsOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IQueryAssetsOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryAssetsOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryAssetsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.QueryAssetsOutputConfig; + + /** + * Decodes a QueryAssetsOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryAssetsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.QueryAssetsOutputConfig; + + /** + * Verifies a QueryAssetsOutputConfig 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 QueryAssetsOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryAssetsOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryAssetsOutputConfig; + + /** + * Creates a plain object from a QueryAssetsOutputConfig message. Also converts values to other types if specified. + * @param message QueryAssetsOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.QueryAssetsOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryAssetsOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAssetsOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QueryAssetsOutputConfig { + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination table */ + table?: (string|null); + + /** BigQueryDestination writeDisposition */ + writeDisposition?: (string|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination table. */ + public table: string; + + /** BigQueryDestination writeDisposition. */ + public writeDisposition: string; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination): google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination; + + /** + * Verifies a BigQueryDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a QueryAssetsRequest. */ + interface IQueryAssetsRequest { + + /** QueryAssetsRequest parent */ + parent?: (string|null); + + /** QueryAssetsRequest statement */ + statement?: (string|null); + + /** QueryAssetsRequest jobReference */ + jobReference?: (string|null); + + /** QueryAssetsRequest pageSize */ + pageSize?: (number|null); + + /** QueryAssetsRequest pageToken */ + pageToken?: (string|null); + + /** QueryAssetsRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + + /** QueryAssetsRequest readTimeWindow */ + readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + + /** QueryAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** QueryAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1.IQueryAssetsOutputConfig|null); + } + + /** Represents a QueryAssetsRequest. */ + class QueryAssetsRequest implements IQueryAssetsRequest { + + /** + * Constructs a new QueryAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IQueryAssetsRequest); + + /** QueryAssetsRequest parent. */ + public parent: string; + + /** QueryAssetsRequest statement. */ + public statement?: (string|null); + + /** QueryAssetsRequest jobReference. */ + public jobReference?: (string|null); + + /** QueryAssetsRequest pageSize. */ + public pageSize: number; + + /** QueryAssetsRequest pageToken. */ + public pageToken: string; + + /** QueryAssetsRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** QueryAssetsRequest readTimeWindow. */ + public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + + /** QueryAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** QueryAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IQueryAssetsOutputConfig|null); + + /** QueryAssetsRequest query. */ + public query?: ("statement"|"jobReference"); + + /** QueryAssetsRequest time. */ + public time?: ("readTimeWindow"|"readTime"); + + /** + * Creates a new QueryAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IQueryAssetsRequest): google.cloud.asset.v1.QueryAssetsRequest; + + /** + * Encodes the specified QueryAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsRequest.verify|verify} messages. + * @param message QueryAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IQueryAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsRequest.verify|verify} messages. + * @param message QueryAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IQueryAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.QueryAssetsRequest; + + /** + * Decodes a QueryAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.QueryAssetsRequest; + + /** + * Verifies a QueryAssetsRequest 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 QueryAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryAssetsRequest; + + /** + * Creates a plain object from a QueryAssetsRequest message. Also converts values to other types if specified. + * @param message QueryAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.QueryAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryAssetsResponse. */ + interface IQueryAssetsResponse { + + /** QueryAssetsResponse jobReference */ + jobReference?: (string|null); + + /** QueryAssetsResponse done */ + done?: (boolean|null); + + /** QueryAssetsResponse error */ + error?: (google.rpc.IStatus|null); + + /** QueryAssetsResponse queryResult */ + queryResult?: (google.cloud.asset.v1.IQueryResult|null); + + /** QueryAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1.IQueryAssetsOutputConfig|null); + } + + /** Represents a QueryAssetsResponse. */ + class QueryAssetsResponse implements IQueryAssetsResponse { + + /** + * Constructs a new QueryAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IQueryAssetsResponse); + + /** QueryAssetsResponse jobReference. */ + public jobReference: string; + + /** QueryAssetsResponse done. */ + public done: boolean; + + /** QueryAssetsResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** QueryAssetsResponse queryResult. */ + public queryResult?: (google.cloud.asset.v1.IQueryResult|null); + + /** QueryAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1.IQueryAssetsOutputConfig|null); + + /** QueryAssetsResponse response. */ + public response?: ("error"|"queryResult"|"outputConfig"); + + /** + * Creates a new QueryAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IQueryAssetsResponse): google.cloud.asset.v1.QueryAssetsResponse; + + /** + * Encodes the specified QueryAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsResponse.verify|verify} messages. + * @param message QueryAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IQueryAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsResponse.verify|verify} messages. + * @param message QueryAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IQueryAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.QueryAssetsResponse; + + /** + * Decodes a QueryAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.QueryAssetsResponse; + + /** + * Verifies a QueryAssetsResponse 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 QueryAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryAssetsResponse; + + /** + * Creates a plain object from a QueryAssetsResponse message. Also converts values to other types if specified. + * @param message QueryAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.QueryAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryResult. */ + interface IQueryResult { + + /** QueryResult rows */ + rows?: (google.protobuf.IStruct[]|null); + + /** QueryResult schema */ + schema?: (google.cloud.asset.v1.ITableSchema|null); + + /** QueryResult nextPageToken */ + nextPageToken?: (string|null); + + /** QueryResult totalRows */ + totalRows?: (number|Long|string|null); + } + + /** Represents a QueryResult. */ + class QueryResult implements IQueryResult { + + /** + * Constructs a new QueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IQueryResult); + + /** QueryResult rows. */ + public rows: google.protobuf.IStruct[]; + + /** QueryResult schema. */ + public schema?: (google.cloud.asset.v1.ITableSchema|null); + + /** QueryResult nextPageToken. */ + public nextPageToken: string; + + /** QueryResult totalRows. */ + public totalRows: (number|Long|string); + + /** + * Creates a new QueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryResult instance + */ + public static create(properties?: google.cloud.asset.v1.IQueryResult): google.cloud.asset.v1.QueryResult; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.asset.v1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.QueryResult; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.QueryResult; + + /** + * Verifies a QueryResult 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 QueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.QueryResult; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @param message QueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableSchema. */ + interface ITableSchema { + + /** TableSchema fields */ + fields?: (google.cloud.asset.v1.ITableFieldSchema[]|null); + } + + /** Represents a TableSchema. */ + class TableSchema implements ITableSchema { + + /** + * Constructs a new TableSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITableSchema); + + /** TableSchema fields. */ + public fields: google.cloud.asset.v1.ITableFieldSchema[]; + + /** + * Creates a new TableSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns TableSchema instance + */ + public static create(properties?: google.cloud.asset.v1.ITableSchema): google.cloud.asset.v1.TableSchema; + + /** + * Encodes the specified TableSchema message. Does not implicitly {@link google.cloud.asset.v1.TableSchema.verify|verify} messages. + * @param message TableSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITableSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableSchema message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TableSchema.verify|verify} messages. + * @param message TableSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITableSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TableSchema; + + /** + * Decodes a TableSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TableSchema; + + /** + * Verifies a TableSchema 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 TableSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TableSchema; + + /** + * Creates a plain object from a TableSchema message. Also converts values to other types if specified. + * @param message TableSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TableSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TableFieldSchema. */ + interface ITableFieldSchema { + + /** TableFieldSchema field */ + field?: (string|null); + + /** TableFieldSchema type */ + type?: (string|null); + + /** TableFieldSchema mode */ + mode?: (string|null); + + /** TableFieldSchema fields */ + fields?: (google.cloud.asset.v1.ITableFieldSchema[]|null); + } + + /** Represents a TableFieldSchema. */ + class TableFieldSchema implements ITableFieldSchema { + + /** + * Constructs a new TableFieldSchema. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITableFieldSchema); + + /** TableFieldSchema field. */ + public field: string; + + /** TableFieldSchema type. */ + public type: string; + + /** TableFieldSchema mode. */ + public mode: string; + + /** TableFieldSchema fields. */ + public fields: google.cloud.asset.v1.ITableFieldSchema[]; + + /** + * Creates a new TableFieldSchema instance using the specified properties. + * @param [properties] Properties to set + * @returns TableFieldSchema instance + */ + public static create(properties?: google.cloud.asset.v1.ITableFieldSchema): google.cloud.asset.v1.TableFieldSchema; + + /** + * Encodes the specified TableFieldSchema message. Does not implicitly {@link google.cloud.asset.v1.TableFieldSchema.verify|verify} messages. + * @param message TableFieldSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITableFieldSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TableFieldSchema message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TableFieldSchema.verify|verify} messages. + * @param message TableFieldSchema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITableFieldSchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TableFieldSchema; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TableFieldSchema; + + /** + * Verifies a TableFieldSchema 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 TableFieldSchema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableFieldSchema + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TableFieldSchema; + + /** + * Creates a plain object from a TableFieldSchema message. Also converts values to other types if specified. + * @param message TableFieldSchema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TableFieldSchema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TableFieldSchema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TableFieldSchema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchGetEffectiveIamPoliciesRequest. */ + interface IBatchGetEffectiveIamPoliciesRequest { + + /** BatchGetEffectiveIamPoliciesRequest scope */ + scope?: (string|null); + + /** BatchGetEffectiveIamPoliciesRequest names */ + names?: (string[]|null); + } + + /** Represents a BatchGetEffectiveIamPoliciesRequest. */ + class BatchGetEffectiveIamPoliciesRequest implements IBatchGetEffectiveIamPoliciesRequest { + + /** + * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest); + + /** BatchGetEffectiveIamPoliciesRequest scope. */ + public scope: string; + + /** BatchGetEffectiveIamPoliciesRequest names. */ + public names: string[]; + + /** + * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetEffectiveIamPoliciesRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetEffectiveIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; + + /** + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetEffectiveIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; + + /** + * Verifies a BatchGetEffectiveIamPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetEffectiveIamPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest; + + /** + * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. + * @param message BatchGetEffectiveIamPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetEffectiveIamPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchGetEffectiveIamPoliciesResponse. */ + interface IBatchGetEffectiveIamPoliciesResponse { + + /** BatchGetEffectiveIamPoliciesResponse policyResults */ + policyResults?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]|null); + } + + /** Represents a BatchGetEffectiveIamPoliciesResponse. */ + class BatchGetEffectiveIamPoliciesResponse implements IBatchGetEffectiveIamPoliciesResponse { + + /** + * Constructs a new BatchGetEffectiveIamPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse); + + /** BatchGetEffectiveIamPoliciesResponse policyResults. */ + public policyResults: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy[]; + + /** + * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetEffectiveIamPoliciesResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @param message BatchGetEffectiveIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetEffectiveIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; + + /** + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetEffectiveIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; + + /** + * Verifies a BatchGetEffectiveIamPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchGetEffectiveIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetEffectiveIamPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse; + + /** + * Creates a plain object from a BatchGetEffectiveIamPoliciesResponse message. Also converts values to other types if specified. + * @param message BatchGetEffectiveIamPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetEffectiveIamPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetEffectiveIamPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BatchGetEffectiveIamPoliciesResponse { + + /** Properties of an EffectiveIamPolicy. */ + interface IEffectiveIamPolicy { + + /** EffectiveIamPolicy fullResourceName */ + fullResourceName?: (string|null); + + /** EffectiveIamPolicy policies */ + policies?: (google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]|null); + } + + /** Represents an EffectiveIamPolicy. */ + class EffectiveIamPolicy implements IEffectiveIamPolicy { + + /** + * Constructs a new EffectiveIamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy); + + /** EffectiveIamPolicy fullResourceName. */ + public fullResourceName: string; + + /** EffectiveIamPolicy policies. */ + public policies: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo[]; + + /** + * Creates a new EffectiveIamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EffectiveIamPolicy instance + */ + public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Encodes the specified EffectiveIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @param message EffectiveIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EffectiveIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @param message EffectiveIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EffectiveIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EffectiveIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Verifies an EffectiveIamPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EffectiveIamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EffectiveIamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy; + + /** + * Creates a plain object from an EffectiveIamPolicy message. Also converts values to other types if specified. + * @param message EffectiveIamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EffectiveIamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EffectiveIamPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EffectiveIamPolicy { + + /** Properties of a PolicyInfo. */ + interface IPolicyInfo { + + /** PolicyInfo attachedResource */ + attachedResource?: (string|null); + + /** PolicyInfo policy */ + policy?: (google.iam.v1.IPolicy|null); + } + + /** Represents a PolicyInfo. */ + class PolicyInfo implements IPolicyInfo { + + /** + * Constructs a new PolicyInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo); + + /** PolicyInfo attachedResource. */ + public attachedResource: string; + + /** PolicyInfo policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** + * Creates a new PolicyInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyInfo instance + */ + public static create(properties?: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Encodes the specified PolicyInfo message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @param message PolicyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyInfo message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @param message PolicyInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Verifies a PolicyInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo; + + /** + * Creates a plain object from a PolicyInfo message. Also converts values to other types if specified. + * @param message PolicyInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an AnalyzerOrgPolicy. */ + interface IAnalyzerOrgPolicy { + + /** AnalyzerOrgPolicy attachedResource */ + attachedResource?: (string|null); + + /** AnalyzerOrgPolicy appliedResource */ + appliedResource?: (string|null); + + /** AnalyzerOrgPolicy rules */ + rules?: (google.cloud.asset.v1.AnalyzerOrgPolicy.IRule[]|null); + + /** AnalyzerOrgPolicy inheritFromParent */ + inheritFromParent?: (boolean|null); + + /** AnalyzerOrgPolicy reset */ + reset?: (boolean|null); + } + + /** Represents an AnalyzerOrgPolicy. */ + class AnalyzerOrgPolicy implements IAnalyzerOrgPolicy { + + /** + * Constructs a new AnalyzerOrgPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzerOrgPolicy); + + /** AnalyzerOrgPolicy attachedResource. */ + public attachedResource: string; + + /** AnalyzerOrgPolicy appliedResource. */ + public appliedResource: string; + + /** AnalyzerOrgPolicy rules. */ + public rules: google.cloud.asset.v1.AnalyzerOrgPolicy.IRule[]; + + /** AnalyzerOrgPolicy inheritFromParent. */ + public inheritFromParent: boolean; + + /** AnalyzerOrgPolicy reset. */ + public reset: boolean; + + /** + * Creates a new AnalyzerOrgPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzerOrgPolicy instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzerOrgPolicy): google.cloud.asset.v1.AnalyzerOrgPolicy; + + /** + * Encodes the specified AnalyzerOrgPolicy message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.verify|verify} messages. + * @param message AnalyzerOrgPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzerOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzerOrgPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.verify|verify} messages. + * @param message AnalyzerOrgPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzerOrgPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzerOrgPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzerOrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzerOrgPolicy; + + /** + * Decodes an AnalyzerOrgPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzerOrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzerOrgPolicy; + + /** + * Verifies an AnalyzerOrgPolicy 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 AnalyzerOrgPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzerOrgPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzerOrgPolicy; + + /** + * Creates a plain object from an AnalyzerOrgPolicy message. Also converts values to other types if specified. + * @param message AnalyzerOrgPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzerOrgPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzerOrgPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzerOrgPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnalyzerOrgPolicy { + + /** Properties of a Rule. */ + interface IRule { + + /** Rule values */ + values?: (google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues|null); + + /** Rule allowAll */ + allowAll?: (boolean|null); + + /** Rule denyAll */ + denyAll?: (boolean|null); + + /** Rule enforce */ + enforce?: (boolean|null); + + /** Rule condition */ + condition?: (google.type.IExpr|null); + + /** Rule conditionEvaluation */ + conditionEvaluation?: (google.cloud.asset.v1.IConditionEvaluation|null); + } + + /** Represents a Rule. */ + class Rule implements IRule { + + /** + * Constructs a new Rule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzerOrgPolicy.IRule); + + /** Rule values. */ + public values?: (google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues|null); + + /** Rule allowAll. */ + public allowAll?: (boolean|null); + + /** Rule denyAll. */ + public denyAll?: (boolean|null); + + /** Rule enforce. */ + public enforce?: (boolean|null); + + /** Rule condition. */ + public condition?: (google.type.IExpr|null); + + /** Rule conditionEvaluation. */ + public conditionEvaluation?: (google.cloud.asset.v1.IConditionEvaluation|null); + + /** Rule kind. */ + public kind?: ("values"|"allowAll"|"denyAll"|"enforce"); + + /** + * Creates a new Rule instance using the specified properties. + * @param [properties] Properties to set + * @returns Rule instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzerOrgPolicy.IRule): google.cloud.asset.v1.AnalyzerOrgPolicy.Rule; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzerOrgPolicy.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.verify|verify} messages. + * @param message Rule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzerOrgPolicy.IRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzerOrgPolicy.Rule; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzerOrgPolicy.Rule; + + /** + * Verifies a Rule 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 Rule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Rule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzerOrgPolicy.Rule; + + /** + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @param message Rule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzerOrgPolicy.Rule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Rule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Rule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Rule { + + /** Properties of a StringValues. */ + interface IStringValues { + + /** StringValues allowedValues */ + allowedValues?: (string[]|null); + + /** StringValues deniedValues */ + deniedValues?: (string[]|null); + } + + /** Represents a StringValues. */ + class StringValues implements IStringValues { + + /** + * Constructs a new StringValues. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues); + + /** StringValues allowedValues. */ + public allowedValues: string[]; + + /** StringValues deniedValues. */ + public deniedValues: string[]; + + /** + * Creates a new StringValues instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValues instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues): google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues; + + /** + * Encodes the specified StringValues message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.verify|verify} messages. + * @param message StringValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValues message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.verify|verify} messages. + * @param message StringValues message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValues message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues; + + /** + * Decodes a StringValues message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues; + + /** + * Verifies a StringValues 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 StringValues message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValues + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues; + + /** + * Creates a plain object from a StringValues message. Also converts values to other types if specified. + * @param message StringValues + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValues to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValues + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an AnalyzerOrgPolicyConstraint. */ + interface IAnalyzerOrgPolicyConstraint { + + /** AnalyzerOrgPolicyConstraint googleDefinedConstraint */ + googleDefinedConstraint?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint|null); + + /** AnalyzerOrgPolicyConstraint customConstraint */ + customConstraint?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint|null); + } + + /** Represents an AnalyzerOrgPolicyConstraint. */ + class AnalyzerOrgPolicyConstraint implements IAnalyzerOrgPolicyConstraint { + + /** + * Constructs a new AnalyzerOrgPolicyConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint); + + /** AnalyzerOrgPolicyConstraint googleDefinedConstraint. */ + public googleDefinedConstraint?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint|null); + + /** AnalyzerOrgPolicyConstraint customConstraint. */ + public customConstraint?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint|null); + + /** AnalyzerOrgPolicyConstraint constraintDefinition. */ + public constraintDefinition?: ("googleDefinedConstraint"|"customConstraint"); + + /** + * Creates a new AnalyzerOrgPolicyConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzerOrgPolicyConstraint instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint; + + /** + * Encodes the specified AnalyzerOrgPolicyConstraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.verify|verify} messages. + * @param message AnalyzerOrgPolicyConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzerOrgPolicyConstraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.verify|verify} messages. + * @param message AnalyzerOrgPolicyConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzerOrgPolicyConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzerOrgPolicyConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint; + + /** + * Decodes an AnalyzerOrgPolicyConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzerOrgPolicyConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint; + + /** + * Verifies an AnalyzerOrgPolicyConstraint 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 AnalyzerOrgPolicyConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzerOrgPolicyConstraint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint; + + /** + * Creates a plain object from an AnalyzerOrgPolicyConstraint message. Also converts values to other types if specified. + * @param message AnalyzerOrgPolicyConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzerOrgPolicyConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzerOrgPolicyConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnalyzerOrgPolicyConstraint { + + /** Properties of a Constraint. */ + interface IConstraint { + + /** Constraint name */ + name?: (string|null); + + /** Constraint displayName */ + displayName?: (string|null); + + /** Constraint description */ + description?: (string|null); + + /** Constraint constraintDefault */ + constraintDefault?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault|keyof typeof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault|null); + + /** Constraint listConstraint */ + listConstraint?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint|null); + + /** Constraint booleanConstraint */ + booleanConstraint?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint|null); + } + + /** Represents a Constraint. */ + class Constraint implements IConstraint { + + /** + * Constructs a new Constraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint); + + /** Constraint name. */ + public name: string; + + /** Constraint displayName. */ + public displayName: string; + + /** Constraint description. */ + public description: string; + + /** Constraint constraintDefault. */ + public constraintDefault: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault|keyof typeof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault); + + /** Constraint listConstraint. */ + public listConstraint?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint|null); + + /** Constraint booleanConstraint. */ + public booleanConstraint?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint|null); + + /** Constraint constraintType. */ + public constraintType?: ("listConstraint"|"booleanConstraint"); + + /** + * Creates a new Constraint instance using the specified properties. + * @param [properties] Properties to set + * @returns Constraint instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint; + + /** + * Encodes the specified Constraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.verify|verify} messages. + * @param message Constraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Constraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.verify|verify} messages. + * @param message Constraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Constraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Constraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint; + + /** + * Decodes a Constraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Constraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint; + + /** + * Verifies a Constraint 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 Constraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Constraint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint; + + /** + * Creates a plain object from a Constraint message. Also converts values to other types if specified. + * @param message Constraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Constraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Constraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Constraint { + + /** ConstraintDefault enum. */ + enum ConstraintDefault { + CONSTRAINT_DEFAULT_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + + /** Properties of a ListConstraint. */ + interface IListConstraint { + + /** ListConstraint supportsIn */ + supportsIn?: (boolean|null); + + /** ListConstraint supportsUnder */ + supportsUnder?: (boolean|null); + } + + /** Represents a ListConstraint. */ + class ListConstraint implements IListConstraint { + + /** + * Constructs a new ListConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint); + + /** ListConstraint supportsIn. */ + public supportsIn: boolean; + + /** ListConstraint supportsUnder. */ + public supportsUnder: boolean; + + /** + * Creates a new ListConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConstraint instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint; + + /** + * Encodes the specified ListConstraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.verify|verify} messages. + * @param message ListConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConstraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.verify|verify} messages. + * @param message ListConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint; + + /** + * Decodes a ListConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint; + + /** + * Verifies a ListConstraint 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 ListConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConstraint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint; + + /** + * Creates a plain object from a ListConstraint message. Also converts values to other types if specified. + * @param message ListConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BooleanConstraint. */ + interface IBooleanConstraint { + } + + /** Represents a BooleanConstraint. */ + class BooleanConstraint implements IBooleanConstraint { + + /** + * Constructs a new BooleanConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint); + + /** + * Creates a new BooleanConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns BooleanConstraint instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint; + + /** + * Encodes the specified BooleanConstraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.verify|verify} messages. + * @param message BooleanConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BooleanConstraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.verify|verify} messages. + * @param message BooleanConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BooleanConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BooleanConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint; + + /** + * Decodes a BooleanConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BooleanConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint; + + /** + * Verifies a BooleanConstraint 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 BooleanConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BooleanConstraint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint; + + /** + * Creates a plain object from a BooleanConstraint message. Also converts values to other types if specified. + * @param message BooleanConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BooleanConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BooleanConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CustomConstraint. */ + interface ICustomConstraint { + + /** CustomConstraint name */ + name?: (string|null); + + /** CustomConstraint resourceTypes */ + resourceTypes?: (string[]|null); + + /** CustomConstraint methodTypes */ + methodTypes?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType[]|null); + + /** CustomConstraint condition */ + condition?: (string|null); + + /** CustomConstraint actionType */ + actionType?: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType|keyof typeof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType|null); + + /** CustomConstraint displayName */ + displayName?: (string|null); + + /** CustomConstraint description */ + description?: (string|null); + } + + /** Represents a CustomConstraint. */ + class CustomConstraint implements ICustomConstraint { + + /** + * Constructs a new CustomConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint); + + /** CustomConstraint name. */ + public name: string; + + /** CustomConstraint resourceTypes. */ + public resourceTypes: string[]; + + /** CustomConstraint methodTypes. */ + public methodTypes: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType[]; + + /** CustomConstraint condition. */ + public condition: string; + + /** CustomConstraint actionType. */ + public actionType: (google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType|keyof typeof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType); + + /** CustomConstraint displayName. */ + public displayName: string; + + /** CustomConstraint description. */ + public description: string; + + /** + * Creates a new CustomConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomConstraint instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint; + + /** + * Encodes the specified CustomConstraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.verify|verify} messages. + * @param message CustomConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomConstraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.verify|verify} messages. + * @param message CustomConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint; + + /** + * Decodes a CustomConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint; + + /** + * Verifies a CustomConstraint 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 CustomConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomConstraint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint; + + /** + * Creates a plain object from a CustomConstraint message. Also converts values to other types if specified. + * @param message CustomConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CustomConstraint { + + /** MethodType enum. */ + enum MethodType { + METHOD_TYPE_UNSPECIFIED = 0, + CREATE = 1, + UPDATE = 2, + DELETE = 3 + } + + /** ActionType enum. */ + enum ActionType { + ACTION_TYPE_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + } + } + + /** Properties of an AnalyzeOrgPoliciesRequest. */ + interface IAnalyzeOrgPoliciesRequest { + + /** AnalyzeOrgPoliciesRequest scope */ + scope?: (string|null); + + /** AnalyzeOrgPoliciesRequest constraint */ + constraint?: (string|null); + + /** AnalyzeOrgPoliciesRequest filter */ + filter?: (string|null); + + /** AnalyzeOrgPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** AnalyzeOrgPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents an AnalyzeOrgPoliciesRequest. */ + class AnalyzeOrgPoliciesRequest implements IAnalyzeOrgPoliciesRequest { + + /** + * Constructs a new AnalyzeOrgPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest); + + /** AnalyzeOrgPoliciesRequest scope. */ + public scope: string; + + /** AnalyzeOrgPoliciesRequest constraint. */ + public constraint: string; + + /** AnalyzeOrgPoliciesRequest filter. */ + public filter: string; + + /** AnalyzeOrgPoliciesRequest pageSize. */ + public pageSize?: (number|null); + + /** AnalyzeOrgPoliciesRequest pageToken. */ + public pageToken: string; + + /** AnalyzeOrgPoliciesRequest _pageSize. */ + public _pageSize?: "pageSize"; + + /** + * Creates a new AnalyzeOrgPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeOrgPoliciesRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest): google.cloud.asset.v1.AnalyzeOrgPoliciesRequest; + + /** + * Encodes the specified AnalyzeOrgPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.verify|verify} messages. + * @param message AnalyzeOrgPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeOrgPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.verify|verify} messages. + * @param message AnalyzeOrgPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeOrgPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeOrgPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPoliciesRequest; + + /** + * Decodes an AnalyzeOrgPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeOrgPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPoliciesRequest; + + /** + * Verifies an AnalyzeOrgPoliciesRequest 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 AnalyzeOrgPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeOrgPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPoliciesRequest; + + /** + * Creates a plain object from an AnalyzeOrgPoliciesRequest message. Also converts values to other types if specified. + * @param message AnalyzeOrgPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeOrgPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeOrgPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeOrgPoliciesResponse. */ + interface IAnalyzeOrgPoliciesResponse { + + /** AnalyzeOrgPoliciesResponse orgPolicyResults */ + orgPolicyResults?: (google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult[]|null); + + /** AnalyzeOrgPoliciesResponse constraint */ + constraint?: (google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null); + + /** AnalyzeOrgPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents an AnalyzeOrgPoliciesResponse. */ + class AnalyzeOrgPoliciesResponse implements IAnalyzeOrgPoliciesResponse { + + /** + * Constructs a new AnalyzeOrgPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse); + + /** AnalyzeOrgPoliciesResponse orgPolicyResults. */ + public orgPolicyResults: google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult[]; + + /** AnalyzeOrgPoliciesResponse constraint. */ + public constraint?: (google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null); + + /** AnalyzeOrgPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new AnalyzeOrgPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeOrgPoliciesResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse): google.cloud.asset.v1.AnalyzeOrgPoliciesResponse; + + /** + * Encodes the specified AnalyzeOrgPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.verify|verify} messages. + * @param message AnalyzeOrgPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeOrgPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.verify|verify} messages. + * @param message AnalyzeOrgPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeOrgPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeOrgPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPoliciesResponse; + + /** + * Decodes an AnalyzeOrgPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeOrgPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPoliciesResponse; + + /** + * Verifies an AnalyzeOrgPoliciesResponse 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 AnalyzeOrgPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeOrgPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPoliciesResponse; + + /** + * Creates a plain object from an AnalyzeOrgPoliciesResponse message. Also converts values to other types if specified. + * @param message AnalyzeOrgPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeOrgPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeOrgPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnalyzeOrgPoliciesResponse { + + /** Properties of an OrgPolicyResult. */ + interface IOrgPolicyResult { + + /** OrgPolicyResult consolidatedPolicy */ + consolidatedPolicy?: (google.cloud.asset.v1.IAnalyzerOrgPolicy|null); + + /** OrgPolicyResult policyBundle */ + policyBundle?: (google.cloud.asset.v1.IAnalyzerOrgPolicy[]|null); + + /** OrgPolicyResult project */ + project?: (string|null); + + /** OrgPolicyResult folders */ + folders?: (string[]|null); + + /** OrgPolicyResult organization */ + organization?: (string|null); + } + + /** Represents an OrgPolicyResult. */ + class OrgPolicyResult implements IOrgPolicyResult { + + /** + * Constructs a new OrgPolicyResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult); + + /** OrgPolicyResult consolidatedPolicy. */ + public consolidatedPolicy?: (google.cloud.asset.v1.IAnalyzerOrgPolicy|null); + + /** OrgPolicyResult policyBundle. */ + public policyBundle: google.cloud.asset.v1.IAnalyzerOrgPolicy[]; + + /** OrgPolicyResult project. */ + public project: string; + + /** OrgPolicyResult folders. */ + public folders: string[]; + + /** OrgPolicyResult organization. */ + public organization: string; + + /** + * Creates a new OrgPolicyResult instance using the specified properties. + * @param [properties] Properties to set + * @returns OrgPolicyResult instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult): google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult; + + /** + * Encodes the specified OrgPolicyResult message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.verify|verify} messages. + * @param message OrgPolicyResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OrgPolicyResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.verify|verify} messages. + * @param message OrgPolicyResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OrgPolicyResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OrgPolicyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult; + + /** + * Decodes an OrgPolicyResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OrgPolicyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult; + + /** + * Verifies an OrgPolicyResult 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 OrgPolicyResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OrgPolicyResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult; + + /** + * Creates a plain object from an OrgPolicyResult message. Also converts values to other types if specified. + * @param message OrgPolicyResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OrgPolicyResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OrgPolicyResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AnalyzeOrgPolicyGovernedContainersRequest. */ + interface IAnalyzeOrgPolicyGovernedContainersRequest { + + /** AnalyzeOrgPolicyGovernedContainersRequest scope */ + scope?: (string|null); + + /** AnalyzeOrgPolicyGovernedContainersRequest constraint */ + constraint?: (string|null); + + /** AnalyzeOrgPolicyGovernedContainersRequest filter */ + filter?: (string|null); + + /** AnalyzeOrgPolicyGovernedContainersRequest pageSize */ + pageSize?: (number|null); + + /** AnalyzeOrgPolicyGovernedContainersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents an AnalyzeOrgPolicyGovernedContainersRequest. */ + class AnalyzeOrgPolicyGovernedContainersRequest implements IAnalyzeOrgPolicyGovernedContainersRequest { + + /** + * Constructs a new AnalyzeOrgPolicyGovernedContainersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest); + + /** AnalyzeOrgPolicyGovernedContainersRequest scope. */ + public scope: string; + + /** AnalyzeOrgPolicyGovernedContainersRequest constraint. */ + public constraint: string; + + /** AnalyzeOrgPolicyGovernedContainersRequest filter. */ + public filter: string; + + /** AnalyzeOrgPolicyGovernedContainersRequest pageSize. */ + public pageSize?: (number|null); + + /** AnalyzeOrgPolicyGovernedContainersRequest pageToken. */ + public pageToken: string; + + /** AnalyzeOrgPolicyGovernedContainersRequest _pageSize. */ + public _pageSize?: "pageSize"; + + /** + * Creates a new AnalyzeOrgPolicyGovernedContainersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeOrgPolicyGovernedContainersRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedContainersRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest.verify|verify} messages. + * @param message AnalyzeOrgPolicyGovernedContainersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedContainersRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest.verify|verify} messages. + * @param message AnalyzeOrgPolicyGovernedContainersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeOrgPolicyGovernedContainersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeOrgPolicyGovernedContainersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest; + + /** + * Decodes an AnalyzeOrgPolicyGovernedContainersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeOrgPolicyGovernedContainersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest; + + /** + * Verifies an AnalyzeOrgPolicyGovernedContainersRequest 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 AnalyzeOrgPolicyGovernedContainersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeOrgPolicyGovernedContainersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest; + + /** + * Creates a plain object from an AnalyzeOrgPolicyGovernedContainersRequest message. Also converts values to other types if specified. + * @param message AnalyzeOrgPolicyGovernedContainersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeOrgPolicyGovernedContainersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeOrgPolicyGovernedContainersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeOrgPolicyGovernedContainersResponse. */ + interface IAnalyzeOrgPolicyGovernedContainersResponse { + + /** AnalyzeOrgPolicyGovernedContainersResponse governedContainers */ + governedContainers?: (google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer[]|null); + + /** AnalyzeOrgPolicyGovernedContainersResponse constraint */ + constraint?: (google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null); + + /** AnalyzeOrgPolicyGovernedContainersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents an AnalyzeOrgPolicyGovernedContainersResponse. */ + class AnalyzeOrgPolicyGovernedContainersResponse implements IAnalyzeOrgPolicyGovernedContainersResponse { + + /** + * Constructs a new AnalyzeOrgPolicyGovernedContainersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse); + + /** AnalyzeOrgPolicyGovernedContainersResponse governedContainers. */ + public governedContainers: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer[]; + + /** AnalyzeOrgPolicyGovernedContainersResponse constraint. */ + public constraint?: (google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null); + + /** AnalyzeOrgPolicyGovernedContainersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new AnalyzeOrgPolicyGovernedContainersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeOrgPolicyGovernedContainersResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedContainersResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.verify|verify} messages. + * @param message AnalyzeOrgPolicyGovernedContainersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedContainersResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.verify|verify} messages. + * @param message AnalyzeOrgPolicyGovernedContainersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeOrgPolicyGovernedContainersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeOrgPolicyGovernedContainersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse; + + /** + * Decodes an AnalyzeOrgPolicyGovernedContainersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeOrgPolicyGovernedContainersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse; + + /** + * Verifies an AnalyzeOrgPolicyGovernedContainersResponse 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 AnalyzeOrgPolicyGovernedContainersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeOrgPolicyGovernedContainersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse; + + /** + * Creates a plain object from an AnalyzeOrgPolicyGovernedContainersResponse message. Also converts values to other types if specified. + * @param message AnalyzeOrgPolicyGovernedContainersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeOrgPolicyGovernedContainersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeOrgPolicyGovernedContainersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnalyzeOrgPolicyGovernedContainersResponse { + + /** Properties of a GovernedContainer. */ + interface IGovernedContainer { + + /** GovernedContainer fullResourceName */ + fullResourceName?: (string|null); + + /** GovernedContainer parent */ + parent?: (string|null); + + /** GovernedContainer consolidatedPolicy */ + consolidatedPolicy?: (google.cloud.asset.v1.IAnalyzerOrgPolicy|null); + + /** GovernedContainer policyBundle */ + policyBundle?: (google.cloud.asset.v1.IAnalyzerOrgPolicy[]|null); + + /** GovernedContainer project */ + project?: (string|null); + + /** GovernedContainer folders */ + folders?: (string[]|null); + + /** GovernedContainer organization */ + organization?: (string|null); + + /** GovernedContainer effectiveTags */ + effectiveTags?: (google.cloud.asset.v1.IEffectiveTagDetails[]|null); + } + + /** Represents a GovernedContainer. */ + class GovernedContainer implements IGovernedContainer { + + /** + * Constructs a new GovernedContainer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer); + + /** GovernedContainer fullResourceName. */ + public fullResourceName: string; + + /** GovernedContainer parent. */ + public parent: string; + + /** GovernedContainer consolidatedPolicy. */ + public consolidatedPolicy?: (google.cloud.asset.v1.IAnalyzerOrgPolicy|null); + + /** GovernedContainer policyBundle. */ + public policyBundle: google.cloud.asset.v1.IAnalyzerOrgPolicy[]; + + /** GovernedContainer project. */ + public project: string; + + /** GovernedContainer folders. */ + public folders: string[]; + + /** GovernedContainer organization. */ + public organization: string; + + /** GovernedContainer effectiveTags. */ + public effectiveTags: google.cloud.asset.v1.IEffectiveTagDetails[]; + + /** + * Creates a new GovernedContainer instance using the specified properties. + * @param [properties] Properties to set + * @returns GovernedContainer instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer; + + /** + * Encodes the specified GovernedContainer message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.verify|verify} messages. + * @param message GovernedContainer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GovernedContainer message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.verify|verify} messages. + * @param message GovernedContainer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GovernedContainer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GovernedContainer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer; + + /** + * Decodes a GovernedContainer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GovernedContainer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer; + + /** + * Verifies a GovernedContainer 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 GovernedContainer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GovernedContainer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer; + + /** + * Creates a plain object from a GovernedContainer message. Also converts values to other types if specified. + * @param message GovernedContainer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GovernedContainer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GovernedContainer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AnalyzeOrgPolicyGovernedAssetsRequest. */ + interface IAnalyzeOrgPolicyGovernedAssetsRequest { + + /** AnalyzeOrgPolicyGovernedAssetsRequest scope */ + scope?: (string|null); + + /** AnalyzeOrgPolicyGovernedAssetsRequest constraint */ + constraint?: (string|null); + + /** AnalyzeOrgPolicyGovernedAssetsRequest filter */ + filter?: (string|null); + + /** AnalyzeOrgPolicyGovernedAssetsRequest pageSize */ + pageSize?: (number|null); + + /** AnalyzeOrgPolicyGovernedAssetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents an AnalyzeOrgPolicyGovernedAssetsRequest. */ + class AnalyzeOrgPolicyGovernedAssetsRequest implements IAnalyzeOrgPolicyGovernedAssetsRequest { + + /** + * Constructs a new AnalyzeOrgPolicyGovernedAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest); + + /** AnalyzeOrgPolicyGovernedAssetsRequest scope. */ + public scope: string; + + /** AnalyzeOrgPolicyGovernedAssetsRequest constraint. */ + public constraint: string; + + /** AnalyzeOrgPolicyGovernedAssetsRequest filter. */ + public filter: string; + + /** AnalyzeOrgPolicyGovernedAssetsRequest pageSize. */ + public pageSize?: (number|null); + + /** AnalyzeOrgPolicyGovernedAssetsRequest pageToken. */ + public pageToken: string; + + /** AnalyzeOrgPolicyGovernedAssetsRequest _pageSize. */ + public _pageSize?: "pageSize"; + + /** + * Creates a new AnalyzeOrgPolicyGovernedAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeOrgPolicyGovernedAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.verify|verify} messages. + * @param message AnalyzeOrgPolicyGovernedAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.verify|verify} messages. + * @param message AnalyzeOrgPolicyGovernedAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeOrgPolicyGovernedAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeOrgPolicyGovernedAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest; + + /** + * Decodes an AnalyzeOrgPolicyGovernedAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeOrgPolicyGovernedAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest; + + /** + * Verifies an AnalyzeOrgPolicyGovernedAssetsRequest 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 AnalyzeOrgPolicyGovernedAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeOrgPolicyGovernedAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest; + + /** + * Creates a plain object from an AnalyzeOrgPolicyGovernedAssetsRequest message. Also converts values to other types if specified. + * @param message AnalyzeOrgPolicyGovernedAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeOrgPolicyGovernedAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeOrgPolicyGovernedAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AnalyzeOrgPolicyGovernedAssetsResponse. */ + interface IAnalyzeOrgPolicyGovernedAssetsResponse { + + /** AnalyzeOrgPolicyGovernedAssetsResponse governedAssets */ + governedAssets?: (google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset[]|null); + + /** AnalyzeOrgPolicyGovernedAssetsResponse constraint */ + constraint?: (google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null); + + /** AnalyzeOrgPolicyGovernedAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents an AnalyzeOrgPolicyGovernedAssetsResponse. */ + class AnalyzeOrgPolicyGovernedAssetsResponse implements IAnalyzeOrgPolicyGovernedAssetsResponse { + + /** + * Constructs a new AnalyzeOrgPolicyGovernedAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse); + + /** AnalyzeOrgPolicyGovernedAssetsResponse governedAssets. */ + public governedAssets: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset[]; + + /** AnalyzeOrgPolicyGovernedAssetsResponse constraint. */ + public constraint?: (google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null); + + /** AnalyzeOrgPolicyGovernedAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new AnalyzeOrgPolicyGovernedAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeOrgPolicyGovernedAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.verify|verify} messages. + * @param message AnalyzeOrgPolicyGovernedAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.verify|verify} messages. + * @param message AnalyzeOrgPolicyGovernedAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeOrgPolicyGovernedAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeOrgPolicyGovernedAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse; + + /** + * Decodes an AnalyzeOrgPolicyGovernedAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeOrgPolicyGovernedAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse; + + /** + * Verifies an AnalyzeOrgPolicyGovernedAssetsResponse 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 AnalyzeOrgPolicyGovernedAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeOrgPolicyGovernedAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse; + + /** + * Creates a plain object from an AnalyzeOrgPolicyGovernedAssetsResponse message. Also converts values to other types if specified. + * @param message AnalyzeOrgPolicyGovernedAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeOrgPolicyGovernedAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AnalyzeOrgPolicyGovernedAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AnalyzeOrgPolicyGovernedAssetsResponse { + + /** Properties of a GovernedResource. */ + interface IGovernedResource { + + /** GovernedResource fullResourceName */ + fullResourceName?: (string|null); + + /** GovernedResource parent */ + parent?: (string|null); + + /** GovernedResource project */ + project?: (string|null); + + /** GovernedResource folders */ + folders?: (string[]|null); + + /** GovernedResource organization */ + organization?: (string|null); + + /** GovernedResource assetType */ + assetType?: (string|null); + + /** GovernedResource effectiveTags */ + effectiveTags?: (google.cloud.asset.v1.IEffectiveTagDetails[]|null); + } + + /** Represents a GovernedResource. */ + class GovernedResource implements IGovernedResource { + + /** + * Constructs a new GovernedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource); + + /** GovernedResource fullResourceName. */ + public fullResourceName: string; + + /** GovernedResource parent. */ + public parent: string; + + /** GovernedResource project. */ + public project: string; + + /** GovernedResource folders. */ + public folders: string[]; + + /** GovernedResource organization. */ + public organization: string; + + /** GovernedResource assetType. */ + public assetType: string; + + /** GovernedResource effectiveTags. */ + public effectiveTags: google.cloud.asset.v1.IEffectiveTagDetails[]; + + /** + * Creates a new GovernedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns GovernedResource instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource; + + /** + * Encodes the specified GovernedResource message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.verify|verify} messages. + * @param message GovernedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GovernedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.verify|verify} messages. + * @param message GovernedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GovernedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GovernedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource; + + /** + * Decodes a GovernedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GovernedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource; + + /** + * Verifies a GovernedResource 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 GovernedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GovernedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource; + + /** + * Creates a plain object from a GovernedResource message. Also converts values to other types if specified. + * @param message GovernedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GovernedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GovernedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GovernedIamPolicy. */ + interface IGovernedIamPolicy { + + /** GovernedIamPolicy attachedResource */ + attachedResource?: (string|null); + + /** GovernedIamPolicy policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** GovernedIamPolicy project */ + project?: (string|null); + + /** GovernedIamPolicy folders */ + folders?: (string[]|null); + + /** GovernedIamPolicy organization */ + organization?: (string|null); + + /** GovernedIamPolicy assetType */ + assetType?: (string|null); + } + + /** Represents a GovernedIamPolicy. */ + class GovernedIamPolicy implements IGovernedIamPolicy { + + /** + * Constructs a new GovernedIamPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy); + + /** GovernedIamPolicy attachedResource. */ + public attachedResource: string; + + /** GovernedIamPolicy policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** GovernedIamPolicy project. */ + public project: string; + + /** GovernedIamPolicy folders. */ + public folders: string[]; + + /** GovernedIamPolicy organization. */ + public organization: string; + + /** GovernedIamPolicy assetType. */ + public assetType: string; + + /** + * Creates a new GovernedIamPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns GovernedIamPolicy instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy; + + /** + * Encodes the specified GovernedIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.verify|verify} messages. + * @param message GovernedIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GovernedIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.verify|verify} messages. + * @param message GovernedIamPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GovernedIamPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GovernedIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy; + + /** + * Decodes a GovernedIamPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GovernedIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy; + + /** + * Verifies a GovernedIamPolicy 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 GovernedIamPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GovernedIamPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy; + + /** + * Creates a plain object from a GovernedIamPolicy message. Also converts values to other types if specified. + * @param message GovernedIamPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GovernedIamPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GovernedIamPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GovernedAsset. */ + interface IGovernedAsset { + + /** GovernedAsset governedResource */ + governedResource?: (google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource|null); + + /** GovernedAsset governedIamPolicy */ + governedIamPolicy?: (google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy|null); + + /** GovernedAsset consolidatedPolicy */ + consolidatedPolicy?: (google.cloud.asset.v1.IAnalyzerOrgPolicy|null); + + /** GovernedAsset policyBundle */ + policyBundle?: (google.cloud.asset.v1.IAnalyzerOrgPolicy[]|null); + } + + /** Represents a GovernedAsset. */ + class GovernedAsset implements IGovernedAsset { + + /** + * Constructs a new GovernedAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset); + + /** GovernedAsset governedResource. */ + public governedResource?: (google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource|null); + + /** GovernedAsset governedIamPolicy. */ + public governedIamPolicy?: (google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy|null); + + /** GovernedAsset consolidatedPolicy. */ + public consolidatedPolicy?: (google.cloud.asset.v1.IAnalyzerOrgPolicy|null); + + /** GovernedAsset policyBundle. */ + public policyBundle: google.cloud.asset.v1.IAnalyzerOrgPolicy[]; + + /** GovernedAsset governedAsset. */ + public governedAsset?: ("governedResource"|"governedIamPolicy"); + + /** + * Creates a new GovernedAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns GovernedAsset instance + */ + public static create(properties?: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset; + + /** + * Encodes the specified GovernedAsset message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.verify|verify} messages. + * @param message GovernedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GovernedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.verify|verify} messages. + * @param message GovernedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GovernedAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GovernedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset; + + /** + * Decodes a GovernedAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GovernedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset; + + /** + * Verifies a GovernedAsset 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 GovernedAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GovernedAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset; + + /** + * Creates a plain object from a GovernedAsset message. Also converts values to other types if specified. + * @param message GovernedAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GovernedAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GovernedAsset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5, + OS_INVENTORY = 6, + RELATIONSHIP = 7 + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState */ + priorAssetState?: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState|null); + + /** TemporalAsset priorAsset */ + priorAsset?: (google.cloud.asset.v1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1.IAsset|null); + + /** TemporalAsset priorAssetState. */ + public priorAssetState: (google.cloud.asset.v1.TemporalAsset.PriorAssetState|keyof typeof google.cloud.asset.v1.TemporalAsset.PriorAssetState); + + /** TemporalAsset priorAsset. */ + public priorAsset?: (google.cloud.asset.v1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1.ITemporalAsset): google.cloud.asset.v1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TemporalAsset; + + /** + * Verifies a TemporalAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TemporalAsset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TemporalAsset { + + /** PriorAssetState enum. */ + enum PriorAssetState { + PRIOR_ASSET_STATE_UNSPECIFIED = 0, + PRESENT = 1, + INVALID = 2, + DOES_NOT_EXIST = 3, + DELETED = 4 + } + } + + /** Properties of a TimeWindow. */ + interface ITimeWindow { + + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { + + /** + * Constructs a new TimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITimeWindow); + + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance + */ + public static create(properties?: google.cloud.asset.v1.ITimeWindow): google.cloud.asset.v1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.TimeWindow; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.TimeWindow; + + /** + * Verifies a TimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.TimeWindow; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset osInventory */ + osInventory?: (google.cloud.osconfig.v1.IInventory|null); + + /** Asset relatedAssets */ + relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + + /** Asset relatedAsset */ + relatedAsset?: (google.cloud.asset.v1.IRelatedAsset|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAsset); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset osInventory. */ + public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + + /** Asset relatedAssets. */ + public relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + + /** Asset relatedAsset. */ + public relatedAsset?: (google.cloud.asset.v1.IRelatedAsset|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1.IAsset): google.cloud.asset.v1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + + /** Resource location */ + location?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** Resource location. */ + public location: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IResource): google.cloud.asset.v1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Resource; + + /** + * Verifies a Resource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelatedAssets. */ + interface IRelatedAssets { + + /** RelatedAssets relationshipAttributes */ + relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets */ + assets?: (google.cloud.asset.v1.IRelatedAsset[]|null); + } + + /** Represents a RelatedAssets. */ + class RelatedAssets implements IRelatedAssets { + + /** + * Constructs a new RelatedAssets. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedAssets); + + /** RelatedAssets relationshipAttributes. */ + public relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets. */ + public assets: google.cloud.asset.v1.IRelatedAsset[]; + + /** + * Creates a new RelatedAssets instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAssets instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedAssets): google.cloud.asset.v1.RelatedAssets; + + /** + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedAssets; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedAssets; + + /** + * Verifies a RelatedAssets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAssets + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAssets; + + /** + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @param message RelatedAssets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedAssets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAssets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedAssets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelationshipAttributes. */ + interface IRelationshipAttributes { + + /** RelationshipAttributes type */ + type?: (string|null); + + /** RelationshipAttributes sourceResourceType */ + sourceResourceType?: (string|null); + + /** RelationshipAttributes targetResourceType */ + targetResourceType?: (string|null); + + /** RelationshipAttributes action */ + action?: (string|null); + } + + /** Represents a RelationshipAttributes. */ + class RelationshipAttributes implements IRelationshipAttributes { + + /** + * Constructs a new RelationshipAttributes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelationshipAttributes); + + /** RelationshipAttributes type. */ + public type: string; + + /** RelationshipAttributes sourceResourceType. */ + public sourceResourceType: string; + + /** RelationshipAttributes targetResourceType. */ + public targetResourceType: string; + + /** RelationshipAttributes action. */ + public action: string; + + /** + * Creates a new RelationshipAttributes instance using the specified properties. + * @param [properties] Properties to set + * @returns RelationshipAttributes instance + */ + public static create(properties?: google.cloud.asset.v1.IRelationshipAttributes): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Verifies a RelationshipAttributes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelationshipAttributes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @param message RelationshipAttributes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelationshipAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelationshipAttributes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelationshipAttributes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelatedAsset. */ + interface IRelatedAsset { + + /** RelatedAsset asset */ + asset?: (string|null); + + /** RelatedAsset assetType */ + assetType?: (string|null); + + /** RelatedAsset ancestors */ + ancestors?: (string[]|null); + + /** RelatedAsset relationshipType */ + relationshipType?: (string|null); + } + + /** Represents a RelatedAsset. */ + class RelatedAsset implements IRelatedAsset { + + /** + * Constructs a new RelatedAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedAsset); + + /** RelatedAsset asset. */ + public asset: string; + + /** RelatedAsset assetType. */ + public assetType: string; + + /** RelatedAsset ancestors. */ + public ancestors: string[]; + + /** RelatedAsset relationshipType. */ + public relationshipType: string; + + /** + * Creates a new RelatedAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAsset instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedAsset): google.cloud.asset.v1.RelatedAsset; + + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedAsset; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedAsset; + + /** + * Verifies a RelatedAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAsset; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @param message RelatedAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedAsset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tag. */ + interface ITag { + + /** Tag tagKey */ + tagKey?: (string|null); + + /** Tag tagKeyId */ + tagKeyId?: (string|null); + + /** Tag tagValue */ + tagValue?: (string|null); + + /** Tag tagValueId */ + tagValueId?: (string|null); + } + + /** Represents a Tag. */ + class Tag implements ITag { + + /** + * Constructs a new Tag. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.ITag); + + /** Tag tagKey. */ + public tagKey?: (string|null); + + /** Tag tagKeyId. */ + public tagKeyId?: (string|null); + + /** Tag tagValue. */ + public tagValue?: (string|null); + + /** Tag tagValueId. */ + public tagValueId?: (string|null); + + /** Tag _tagKey. */ + public _tagKey?: "tagKey"; + + /** Tag _tagKeyId. */ + public _tagKeyId?: "tagKeyId"; + + /** Tag _tagValue. */ + public _tagValue?: "tagValue"; + + /** Tag _tagValueId. */ + public _tagValueId?: "tagValueId"; + + /** + * Creates a new Tag instance using the specified properties. + * @param [properties] Properties to set + * @returns Tag instance + */ + public static create(properties?: google.cloud.asset.v1.ITag): google.cloud.asset.v1.Tag; + + /** + * Encodes the specified Tag message. Does not implicitly {@link google.cloud.asset.v1.Tag.verify|verify} messages. + * @param message Tag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.ITag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tag message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Tag.verify|verify} messages. + * @param message Tag message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.ITag, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tag message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.Tag; + + /** + * Decodes a Tag message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.Tag; + + /** + * Verifies a Tag 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 Tag message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tag + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.Tag; + + /** + * Creates a plain object from a Tag message. Also converts values to other types if specified. + * @param message Tag + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.Tag, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tag to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tag + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EffectiveTagDetails. */ + interface IEffectiveTagDetails { + + /** EffectiveTagDetails attachedResource */ + attachedResource?: (string|null); + + /** EffectiveTagDetails effectiveTags */ + effectiveTags?: (google.cloud.asset.v1.ITag[]|null); + } + + /** Represents an EffectiveTagDetails. */ + class EffectiveTagDetails implements IEffectiveTagDetails { + + /** + * Constructs a new EffectiveTagDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IEffectiveTagDetails); + + /** EffectiveTagDetails attachedResource. */ + public attachedResource?: (string|null); + + /** EffectiveTagDetails effectiveTags. */ + public effectiveTags: google.cloud.asset.v1.ITag[]; + + /** EffectiveTagDetails _attachedResource. */ + public _attachedResource?: "attachedResource"; + + /** + * Creates a new EffectiveTagDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns EffectiveTagDetails instance + */ + public static create(properties?: google.cloud.asset.v1.IEffectiveTagDetails): google.cloud.asset.v1.EffectiveTagDetails; + + /** + * Encodes the specified EffectiveTagDetails message. Does not implicitly {@link google.cloud.asset.v1.EffectiveTagDetails.verify|verify} messages. + * @param message EffectiveTagDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IEffectiveTagDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EffectiveTagDetails message, length delimited. Does not implicitly {@link google.cloud.asset.v1.EffectiveTagDetails.verify|verify} messages. + * @param message EffectiveTagDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IEffectiveTagDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EffectiveTagDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EffectiveTagDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.EffectiveTagDetails; + + /** + * Decodes an EffectiveTagDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EffectiveTagDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.EffectiveTagDetails; + + /** + * Verifies an EffectiveTagDetails 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 EffectiveTagDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EffectiveTagDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.EffectiveTagDetails; + + /** + * Creates a plain object from an EffectiveTagDetails message. Also converts values to other types if specified. + * @param message EffectiveTagDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.EffectiveTagDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EffectiveTagDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EffectiveTagDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResourceSearchResult. */ + interface IResourceSearchResult { + + /** ResourceSearchResult name */ + name?: (string|null); + + /** ResourceSearchResult assetType */ + assetType?: (string|null); + + /** ResourceSearchResult project */ + project?: (string|null); + + /** ResourceSearchResult folders */ + folders?: (string[]|null); + + /** ResourceSearchResult organization */ + organization?: (string|null); + + /** ResourceSearchResult displayName */ + displayName?: (string|null); + + /** ResourceSearchResult description */ + description?: (string|null); + + /** ResourceSearchResult location */ + location?: (string|null); + + /** ResourceSearchResult labels */ + labels?: ({ [k: string]: string }|null); + + /** ResourceSearchResult networkTags */ + networkTags?: (string[]|null); + + /** ResourceSearchResult kmsKey */ + kmsKey?: (string|null); + + /** ResourceSearchResult kmsKeys */ + kmsKeys?: (string[]|null); + + /** ResourceSearchResult createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state */ + state?: (string|null); + + /** ResourceSearchResult additionalAttributes */ + additionalAttributes?: (google.protobuf.IStruct|null); + + /** ResourceSearchResult parentFullResourceName */ + parentFullResourceName?: (string|null); + + /** ResourceSearchResult versionedResources */ + versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); + + /** ResourceSearchResult attachedResources */ + attachedResources?: (google.cloud.asset.v1.IAttachedResource[]|null); + + /** ResourceSearchResult relationships */ + relationships?: ({ [k: string]: google.cloud.asset.v1.IRelatedResources }|null); + + /** ResourceSearchResult tagKeys */ + tagKeys?: (string[]|null); + + /** ResourceSearchResult tagValues */ + tagValues?: (string[]|null); + + /** ResourceSearchResult tagValueIds */ + tagValueIds?: (string[]|null); + + /** ResourceSearchResult tags */ + tags?: (google.cloud.asset.v1.ITag[]|null); + + /** ResourceSearchResult effectiveTags */ + effectiveTags?: (google.cloud.asset.v1.IEffectiveTagDetails[]|null); + + /** ResourceSearchResult parentAssetType */ + parentAssetType?: (string|null); + + /** ResourceSearchResult sccSecurityMarks */ + sccSecurityMarks?: ({ [k: string]: string }|null); + } + + /** Represents a ResourceSearchResult. */ + class ResourceSearchResult implements IResourceSearchResult { + + /** + * Constructs a new ResourceSearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IResourceSearchResult); + + /** ResourceSearchResult name. */ + public name: string; + + /** ResourceSearchResult assetType. */ + public assetType: string; + + /** ResourceSearchResult project. */ + public project: string; + + /** ResourceSearchResult folders. */ + public folders: string[]; + + /** ResourceSearchResult organization. */ + public organization: string; + + /** ResourceSearchResult displayName. */ + public displayName: string; + + /** ResourceSearchResult description. */ + public description: string; + + /** ResourceSearchResult location. */ + public location: string; + + /** ResourceSearchResult labels. */ + public labels: { [k: string]: string }; + + /** ResourceSearchResult networkTags. */ + public networkTags: string[]; + + /** ResourceSearchResult kmsKey. */ + public kmsKey: string; + + /** ResourceSearchResult kmsKeys. */ + public kmsKeys: string[]; + + /** ResourceSearchResult createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ResourceSearchResult state. */ + public state: string; + + /** ResourceSearchResult additionalAttributes. */ + public additionalAttributes?: (google.protobuf.IStruct|null); + + /** ResourceSearchResult parentFullResourceName. */ + public parentFullResourceName: string; + + /** ResourceSearchResult versionedResources. */ + public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + + /** ResourceSearchResult attachedResources. */ + public attachedResources: google.cloud.asset.v1.IAttachedResource[]; + + /** ResourceSearchResult relationships. */ + public relationships: { [k: string]: google.cloud.asset.v1.IRelatedResources }; + + /** ResourceSearchResult tagKeys. */ + public tagKeys: string[]; + + /** ResourceSearchResult tagValues. */ + public tagValues: string[]; + + /** ResourceSearchResult tagValueIds. */ + public tagValueIds: string[]; + + /** ResourceSearchResult tags. */ + public tags: google.cloud.asset.v1.ITag[]; + + /** ResourceSearchResult effectiveTags. */ + public effectiveTags: google.cloud.asset.v1.IEffectiveTagDetails[]; + + /** ResourceSearchResult parentAssetType. */ + public parentAssetType: string; + + /** ResourceSearchResult sccSecurityMarks. */ + public sccSecurityMarks: { [k: string]: string }; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceSearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IResourceSearchResult): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @param message ResourceSearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IResourceSearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Verifies a ResourceSearchResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceSearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ResourceSearchResult; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @param message ResourceSearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ResourceSearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceSearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceSearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VersionedResource. */ + interface IVersionedResource { + + /** VersionedResource version */ + version?: (string|null); + + /** VersionedResource resource */ + resource?: (google.protobuf.IStruct|null); + } + + /** Represents a VersionedResource. */ + class VersionedResource implements IVersionedResource { + + /** + * Constructs a new VersionedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IVersionedResource); + + /** VersionedResource version. */ + public version: string; + + /** VersionedResource resource. */ + public resource?: (google.protobuf.IStruct|null); + + /** + * Creates a new VersionedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IVersionedResource): google.cloud.asset.v1.VersionedResource; + + /** + * Encodes the specified VersionedResource message. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @param message VersionedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @param message VersionedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IVersionedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.VersionedResource; + + /** + * Decodes a VersionedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.VersionedResource; + + /** + * Verifies a VersionedResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VersionedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.VersionedResource; + + /** + * Creates a plain object from a VersionedResource message. Also converts values to other types if specified. + * @param message VersionedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.VersionedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttachedResource. */ + interface IAttachedResource { + + /** AttachedResource assetType */ + assetType?: (string|null); + + /** AttachedResource versionedResources */ + versionedResources?: (google.cloud.asset.v1.IVersionedResource[]|null); + } + + /** Represents an AttachedResource. */ + class AttachedResource implements IAttachedResource { + + /** + * Constructs a new AttachedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IAttachedResource); + + /** AttachedResource assetType. */ + public assetType: string; + + /** AttachedResource versionedResources. */ + public versionedResources: google.cloud.asset.v1.IVersionedResource[]; + + /** + * Creates a new AttachedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IAttachedResource): google.cloud.asset.v1.AttachedResource; + + /** + * Encodes the specified AttachedResource message. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @param message AttachedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @param message AttachedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IAttachedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.AttachedResource; + + /** + * Decodes an AttachedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.AttachedResource; + + /** + * Verifies an AttachedResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.AttachedResource; + + /** + * Creates a plain object from an AttachedResource message. Also converts values to other types if specified. + * @param message AttachedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.AttachedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelatedResources. */ + interface IRelatedResources { + + /** RelatedResources relatedResources */ + relatedResources?: (google.cloud.asset.v1.IRelatedResource[]|null); + } + + /** Represents a RelatedResources. */ + class RelatedResources implements IRelatedResources { + + /** + * Constructs a new RelatedResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedResources); + + /** RelatedResources relatedResources. */ + public relatedResources: google.cloud.asset.v1.IRelatedResource[]; + + /** + * Creates a new RelatedResources instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedResources instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedResources): google.cloud.asset.v1.RelatedResources; + + /** + * Encodes the specified RelatedResources message. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @param message RelatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedResources message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @param message RelatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedResources; + + /** + * Decodes a RelatedResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedResources; + + /** + * Verifies a RelatedResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResources; + + /** + * Creates a plain object from a RelatedResources message. Also converts values to other types if specified. + * @param message RelatedResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelatedResource. */ + interface IRelatedResource { + + /** RelatedResource assetType */ + assetType?: (string|null); + + /** RelatedResource fullResourceName */ + fullResourceName?: (string|null); + } + + /** Represents a RelatedResource. */ + class RelatedResource implements IRelatedResource { + + /** + * Constructs a new RelatedResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedResource); + + /** RelatedResource assetType. */ + public assetType: string; + + /** RelatedResource fullResourceName. */ + public fullResourceName: string; + + /** + * Creates a new RelatedResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedResource instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedResource): google.cloud.asset.v1.RelatedResource; + + /** + * Encodes the specified RelatedResource message. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @param message RelatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @param message RelatedResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedResource; + + /** + * Decodes a RelatedResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedResource; + + /** + * Verifies a RelatedResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedResource; + + /** + * Creates a plain object from a RelatedResource message. Also converts values to other types if specified. + * @param message RelatedResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { + + /** IamPolicySearchResult resource */ + resource?: (string|null); + + /** IamPolicySearchResult assetType */ + assetType?: (string|null); + + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult folders */ + folders?: (string[]|null); + + /** IamPolicySearchResult organization */ + organization?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + } + + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { + + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicySearchResult); + + /** IamPolicySearchResult resource. */ + public resource: string; + + /** IamPolicySearchResult assetType. */ + public assetType: string; + + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult folders. */ + public folders: string[]; + + /** IamPolicySearchResult organization. */ + public organization: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null); + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicySearchResult): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Verifies an IamPolicySearchResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicySearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation); + + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions }; + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Verifies an Explanation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Explanation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Explanation { + + /** Properties of a Permissions. */ + interface IPermissions { + + /** Permissions permissions */ + permissions?: (string[]|null); + } + + /** Represents a Permissions. */ + class Permissions implements IPermissions { + + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions); + + /** Permissions permissions. */ + public permissions: string[]; + + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Verifies a Permissions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Permissions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an IamPolicyAnalysisState. */ + interface IIamPolicyAnalysisState { + + /** IamPolicyAnalysisState code */ + code?: (google.rpc.Code|keyof typeof google.rpc.Code|null); + + /** IamPolicyAnalysisState cause */ + cause?: (string|null); + } + + /** Represents an IamPolicyAnalysisState. */ + class IamPolicyAnalysisState implements IIamPolicyAnalysisState { + + /** + * Constructs a new IamPolicyAnalysisState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState); + + /** IamPolicyAnalysisState code. */ + public code: (google.rpc.Code|keyof typeof google.rpc.Code); + + /** IamPolicyAnalysisState cause. */ + public cause: string; + + /** + * Creates a new IamPolicyAnalysisState instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisState instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisState): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @param message IamPolicyAnalysisState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Verifies an IamPolicyAnalysisState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisState; + + /** + * Creates a plain object from an IamPolicyAnalysisState message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConditionEvaluation. */ + interface IConditionEvaluation { + + /** ConditionEvaluation evaluationValue */ + evaluationValue?: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|null); + } + + /** Represents a ConditionEvaluation. */ + class ConditionEvaluation implements IConditionEvaluation { + + /** + * Constructs a new ConditionEvaluation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IConditionEvaluation); + + /** ConditionEvaluation evaluationValue. */ + public evaluationValue: (google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|keyof typeof google.cloud.asset.v1.ConditionEvaluation.EvaluationValue); + + /** + * Creates a new ConditionEvaluation instance using the specified properties. + * @param [properties] Properties to set + * @returns ConditionEvaluation instance + */ + public static create(properties?: google.cloud.asset.v1.IConditionEvaluation): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Encodes the specified ConditionEvaluation message. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @param message ConditionEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConditionEvaluation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @param message ConditionEvaluation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IConditionEvaluation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConditionEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConditionEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Verifies a ConditionEvaluation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConditionEvaluation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConditionEvaluation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.ConditionEvaluation; + + /** + * Creates a plain object from a ConditionEvaluation message. Also converts values to other types if specified. + * @param message ConditionEvaluation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.ConditionEvaluation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConditionEvaluation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConditionEvaluation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ConditionEvaluation { + + /** EvaluationValue enum. */ + enum EvaluationValue { + EVALUATION_VALUE_UNSPECIFIED = 0, + TRUE = 1, + FALSE = 2, + CONDITIONAL = 3 + } + } + + /** Properties of an IamPolicyAnalysisResult. */ + interface IIamPolicyAnalysisResult { + + /** IamPolicyAnalysisResult attachedResourceFullName */ + attachedResourceFullName?: (string|null); + + /** IamPolicyAnalysisResult iamBinding */ + iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists */ + accessControlLists?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]|null); + + /** IamPolicyAnalysisResult identityList */ + identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored */ + fullyExplored?: (boolean|null); + } + + /** Represents an IamPolicyAnalysisResult. */ + class IamPolicyAnalysisResult implements IIamPolicyAnalysisResult { + + /** + * Constructs a new IamPolicyAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult); + + /** IamPolicyAnalysisResult attachedResourceFullName. */ + public attachedResourceFullName: string; + + /** IamPolicyAnalysisResult iamBinding. */ + public iamBinding?: (google.iam.v1.IBinding|null); + + /** IamPolicyAnalysisResult accessControlLists. */ + public accessControlLists: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList[]; + + /** IamPolicyAnalysisResult identityList. */ + public identityList?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null); + + /** IamPolicyAnalysisResult fullyExplored. */ + public fullyExplored: boolean; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicyAnalysisResult instance + */ + public static create(properties?: google.cloud.asset.v1.IIamPolicyAnalysisResult): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicyAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @param message IamPolicyAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IIamPolicyAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Decodes an IamPolicyAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicyAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Verifies an IamPolicyAnalysisResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamPolicyAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicyAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult; + + /** + * Creates a plain object from an IamPolicyAnalysisResult message. Also converts values to other types if specified. + * @param message IamPolicyAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicyAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicyAnalysisResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IamPolicyAnalysisResult { + + /** Properties of a Resource. */ + interface IResource { + + /** Resource fullResourceName */ + fullResourceName?: (string|null); + + /** Resource analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource); + + /** Resource fullResourceName. */ + public fullResourceName: string; + + /** Resource analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Verifies a Resource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Resource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.IamPolicyAnalysisResult.Resource; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @param message Resource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.IamPolicyAnalysisResult.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Access. */ + interface IAccess { + + /** Access role */ + role?: (string|null); + + /** Access permission */ + permission?: (string|null); + + /** Access analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents an Access. */ + class Access implements IAccess { + + /** + * Constructs a new Access. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess); + + /** Access role. */ + public role?: (string|null); + + /** Access permission. */ + public permission?: (string|null); + + /** Access analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|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.v1.IamPolicyAnalysisResult.IAccess): google.cloud.asset.v1.IamPolicyAnalysisResult.Access; + + /** + * Encodes the specified Access message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IAccess, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Access message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.Access, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Access to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Access + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Identity. */ + interface IIdentity { + + /** Identity name */ + name?: (string|null); + + /** Identity analysisState */ + analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|null); + } + + /** Represents an Identity. */ + class Identity implements IIdentity { + + /** + * Constructs a new Identity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity); + + /** Identity name. */ + public name: string; + + /** Identity analysisState. */ + public analysisState?: (google.cloud.asset.v1.IIamPolicyAnalysisState|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.v1.IamPolicyAnalysisResult.IIdentity): google.cloud.asset.v1.IamPolicyAnalysisResult.Identity; + + /** + * Encodes the specified Identity message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Identity message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.Identity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Identity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Identity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v1.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.v1.IamPolicyAnalysisResult.IEdge): google.cloud.asset.v1.IamPolicyAnalysisResult.Edge; + + /** + * Encodes the specified Edge message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IEdge, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Edge message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.Edge, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Edge to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Edge + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessControlList. */ + interface IAccessControlList { + + /** AccessControlList resources */ + resources?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IResource[]|null); + + /** AccessControlList accesses */ + accesses?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess[]|null); + + /** AccessControlList resourceEdges */ + resourceEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); + + /** AccessControlList conditionEvaluation */ + conditionEvaluation?: (google.cloud.asset.v1.IConditionEvaluation|null); + } + + /** Represents an AccessControlList. */ + class AccessControlList implements IAccessControlList { + + /** + * Constructs a new AccessControlList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList); + + /** AccessControlList resources. */ + public resources: google.cloud.asset.v1.IamPolicyAnalysisResult.IResource[]; + + /** AccessControlList accesses. */ + public accesses: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess[]; + + /** AccessControlList resourceEdges. */ + public resourceEdges: google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]; + + /** AccessControlList conditionEvaluation. */ + public conditionEvaluation?: (google.cloud.asset.v1.IConditionEvaluation|null); + + /** + * Creates a new AccessControlList instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessControlList instance + */ + public static create(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList): google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList; + + /** + * Encodes the specified AccessControlList message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IAccessControlList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.AccessControlList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessControlList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessControlList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IdentityList. */ + interface IIdentityList { + + /** IdentityList identities */ + identities?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity[]|null); + + /** IdentityList groupEdges */ + groupEdges?: (google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge[]|null); + } + + /** Represents an IdentityList. */ + class IdentityList implements IIdentityList { + + /** + * Constructs a new IdentityList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList); + + /** IdentityList identities. */ + public identities: google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity[]; + + /** IdentityList groupEdges. */ + public groupEdges: google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IIdentityList): google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList; + + /** + * Encodes the specified IdentityList message. Does not implicitly {@link google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IIdentityList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IdentityList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.IdentityList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IdentityList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IdentityList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace orgpolicy. */ + namespace orgpolicy { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy constraint */ + constraint?: (string|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + + /** Policy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Policy listPolicy */ + listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); + + /** Policy booleanPolicy */ + booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); + + /** Policy restoreDefault */ + restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy constraint. */ + public constraint: string; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** Policy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Policy listPolicy. */ + public listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); + + /** Policy booleanPolicy. */ + public booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); + + /** Policy restoreDefault. */ + public restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + + /** Policy policyType. */ + public policyType?: ("listPolicy"|"booleanPolicy"|"restoreDefault"); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.IPolicy): google.cloud.orgpolicy.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.orgpolicy.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.orgpolicy.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Policy { + + /** Properties of a ListPolicy. */ + interface IListPolicy { + + /** ListPolicy allowedValues */ + allowedValues?: (string[]|null); + + /** ListPolicy deniedValues */ + deniedValues?: (string[]|null); + + /** ListPolicy allValues */ + allValues?: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null); + + /** ListPolicy suggestedValue */ + suggestedValue?: (string|null); + + /** ListPolicy inheritFromParent */ + inheritFromParent?: (boolean|null); + } + + /** Represents a ListPolicy. */ + class ListPolicy implements IListPolicy { + + /** + * Constructs a new ListPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy); + + /** ListPolicy allowedValues. */ + public allowedValues: string[]; + + /** ListPolicy deniedValues. */ + public deniedValues: string[]; + + /** ListPolicy allValues. */ + public allValues: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues); + + /** ListPolicy suggestedValue. */ + public suggestedValue: string; + + /** ListPolicy inheritFromParent. */ + public inheritFromParent: boolean; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; + + /** + * Verifies a ListPolicy 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 ListPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @param message ListPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.ListPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListPolicy { + + /** AllValues enum. */ + enum AllValues { + ALL_VALUES_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + } + + /** Properties of a BooleanPolicy. */ + interface IBooleanPolicy { + + /** BooleanPolicy enforced */ + enforced?: (boolean|null); + } + + /** Represents a BooleanPolicy. */ + class BooleanPolicy implements IBooleanPolicy { + + /** + * Constructs a new BooleanPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy); + + /** BooleanPolicy enforced. */ + public enforced: boolean; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BooleanPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Verifies a BooleanPolicy 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 BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BooleanPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @param message BooleanPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.BooleanPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BooleanPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BooleanPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDefault. */ + interface IRestoreDefault { + } + + /** Represents a RestoreDefault. */ + class RestoreDefault implements IRestoreDefault { + + /** + * Constructs a new RestoreDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault); + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDefault instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Verifies a RestoreDefault 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 RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDefault + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @param message RestoreDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.RestoreDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace osconfig. */ + namespace osconfig { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an Inventory. */ + interface IInventory { + + /** Inventory name */ + name?: (string|null); + + /** Inventory osInfo */ + osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); + + /** Inventory items */ + items?: ({ [k: string]: google.cloud.osconfig.v1.Inventory.IItem }|null); + + /** Inventory updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Inventory. */ + class Inventory implements IInventory { + + /** + * Constructs a new Inventory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IInventory); + + /** Inventory name. */ + public name: string; + + /** Inventory osInfo. */ + public osInfo?: (google.cloud.osconfig.v1.Inventory.IOsInfo|null); + + /** Inventory items. */ + public items: { [k: string]: google.cloud.osconfig.v1.Inventory.IItem }; + + /** Inventory updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Inventory instance using the specified properties. + * @param [properties] Properties to set + * @returns Inventory instance + */ + public static create(properties?: google.cloud.osconfig.v1.IInventory): google.cloud.osconfig.v1.Inventory; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @param message Inventory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IInventory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Inventory + * @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.osconfig.v1.Inventory; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Inventory + * @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.osconfig.v1.Inventory; + + /** + * Verifies an Inventory 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 Inventory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Inventory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @param message Inventory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Inventory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Inventory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Inventory { + + /** Properties of an OsInfo. */ + interface IOsInfo { + + /** OsInfo hostname */ + hostname?: (string|null); + + /** OsInfo longName */ + longName?: (string|null); + + /** OsInfo shortName */ + shortName?: (string|null); + + /** OsInfo version */ + version?: (string|null); + + /** OsInfo architecture */ + architecture?: (string|null); + + /** OsInfo kernelVersion */ + kernelVersion?: (string|null); + + /** OsInfo kernelRelease */ + kernelRelease?: (string|null); + + /** OsInfo osconfigAgentVersion */ + osconfigAgentVersion?: (string|null); + } + + /** Represents an OsInfo. */ + class OsInfo implements IOsInfo { + + /** + * Constructs a new OsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IOsInfo); + + /** OsInfo hostname. */ + public hostname: string; + + /** OsInfo longName. */ + public longName: string; + + /** OsInfo shortName. */ + public shortName: string; + + /** OsInfo version. */ + public version: string; + + /** OsInfo architecture. */ + public architecture: string; + + /** OsInfo kernelVersion. */ + public kernelVersion: string; + + /** OsInfo kernelRelease. */ + public kernelRelease: string; + + /** OsInfo osconfigAgentVersion. */ + public osconfigAgentVersion: string; + + /** + * Creates a new OsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OsInfo instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IOsInfo): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @param message OsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IOsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsInfo + * @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.osconfig.v1.Inventory.OsInfo; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsInfo + * @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.osconfig.v1.Inventory.OsInfo; + + /** + * Verifies an OsInfo 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 OsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.OsInfo; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @param message OsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.OsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Item. */ + interface IItem { + + /** Item id */ + id?: (string|null); + + /** Item originType */ + originType?: (google.cloud.osconfig.v1.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1.Inventory.Item.OriginType|null); + + /** Item createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type */ + type?: (google.cloud.osconfig.v1.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1.Inventory.Item.Type|null); + + /** Item installedPackage */ + installedPackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item availablePackage */ + availablePackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IItem); + + /** Item id. */ + public id: string; + + /** Item originType. */ + public originType: (google.cloud.osconfig.v1.Inventory.Item.OriginType|keyof typeof google.cloud.osconfig.v1.Inventory.Item.OriginType); + + /** Item createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Item updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Item type. */ + public type: (google.cloud.osconfig.v1.Inventory.Item.Type|keyof typeof google.cloud.osconfig.v1.Inventory.Item.Type); + + /** Item installedPackage. */ + public installedPackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item availablePackage. */ + public availablePackage?: (google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null); + + /** Item details. */ + public details?: ("installedPackage"|"availablePackage"); + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IItem): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @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.osconfig.v1.Inventory.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @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.osconfig.v1.Inventory.Item; + + /** + * Verifies an Item 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 Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Item + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Item { + + /** OriginType enum. */ + enum OriginType { + ORIGIN_TYPE_UNSPECIFIED = 0, + INVENTORY_REPORT = 1 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + INSTALLED_PACKAGE = 1, + AVAILABLE_PACKAGE = 2 + } + } + + /** Properties of a SoftwarePackage. */ + interface ISoftwarePackage { + + /** SoftwarePackage yumPackage */ + yumPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage */ + aptPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage */ + zypperPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage */ + googetPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch */ + zypperPatch?: (google.cloud.osconfig.v1.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage */ + wuaPackage?: (google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage */ + qfePackage?: (google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage */ + cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage windowsApplication */ + windowsApplication?: (google.cloud.osconfig.v1.Inventory.IWindowsApplication|null); + } + + /** Represents a SoftwarePackage. */ + class SoftwarePackage implements ISoftwarePackage { + + /** + * Constructs a new SoftwarePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.ISoftwarePackage); + + /** SoftwarePackage yumPackage. */ + public yumPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage aptPackage. */ + public aptPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPackage. */ + public zypperPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage googetPackage. */ + public googetPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage zypperPatch. */ + public zypperPatch?: (google.cloud.osconfig.v1.Inventory.IZypperPatch|null); + + /** SoftwarePackage wuaPackage. */ + public wuaPackage?: (google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null); + + /** SoftwarePackage qfePackage. */ + public qfePackage?: (google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null); + + /** SoftwarePackage cosPackage. */ + public cosPackage?: (google.cloud.osconfig.v1.Inventory.IVersionedPackage|null); + + /** SoftwarePackage windowsApplication. */ + public windowsApplication?: (google.cloud.osconfig.v1.Inventory.IWindowsApplication|null); + + /** SoftwarePackage details. */ + public details?: ("yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns SoftwarePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.ISoftwarePackage): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @param message SoftwarePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.ISoftwarePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SoftwarePackage + * @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.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SoftwarePackage + * @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.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Verifies a SoftwarePackage 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 SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SoftwarePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.SoftwarePackage; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @param message SoftwarePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.SoftwarePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SoftwarePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SoftwarePackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VersionedPackage. */ + interface IVersionedPackage { + + /** VersionedPackage packageName */ + packageName?: (string|null); + + /** VersionedPackage architecture */ + architecture?: (string|null); + + /** VersionedPackage version */ + version?: (string|null); + } + + /** Represents a VersionedPackage. */ + class VersionedPackage implements IVersionedPackage { + + /** + * Constructs a new VersionedPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IVersionedPackage); + + /** VersionedPackage packageName. */ + public packageName: string; + + /** VersionedPackage architecture. */ + public architecture: string; + + /** VersionedPackage version. */ + public version: string; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns VersionedPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IVersionedPackage): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @param message VersionedPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IVersionedPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VersionedPackage + * @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.osconfig.v1.Inventory.VersionedPackage; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VersionedPackage + * @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.osconfig.v1.Inventory.VersionedPackage; + + /** + * Verifies a VersionedPackage 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 VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VersionedPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.VersionedPackage; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @param message VersionedPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.VersionedPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VersionedPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VersionedPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ZypperPatch. */ + interface IZypperPatch { + + /** ZypperPatch patchName */ + patchName?: (string|null); + + /** ZypperPatch category */ + category?: (string|null); + + /** ZypperPatch severity */ + severity?: (string|null); + + /** ZypperPatch summary */ + summary?: (string|null); + } + + /** Represents a ZypperPatch. */ + class ZypperPatch implements IZypperPatch { + + /** + * Constructs a new ZypperPatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch); + + /** ZypperPatch patchName. */ + public patchName: string; + + /** ZypperPatch category. */ + public category: string; + + /** ZypperPatch severity. */ + public severity: string; + + /** ZypperPatch summary. */ + public summary: string; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @param [properties] Properties to set + * @returns ZypperPatch instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IZypperPatch): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @param message ZypperPatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IZypperPatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ZypperPatch + * @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.osconfig.v1.Inventory.ZypperPatch; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ZypperPatch + * @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.osconfig.v1.Inventory.ZypperPatch; + + /** + * Verifies a ZypperPatch 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 ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ZypperPatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.ZypperPatch; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @param message ZypperPatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.ZypperPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ZypperPatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ZypperPatch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WindowsUpdatePackage. */ + interface IWindowsUpdatePackage { + + /** WindowsUpdatePackage title */ + title?: (string|null); + + /** WindowsUpdatePackage description */ + description?: (string|null); + + /** WindowsUpdatePackage categories */ + categories?: (google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]|null); + + /** WindowsUpdatePackage kbArticleIds */ + kbArticleIds?: (string[]|null); + + /** WindowsUpdatePackage supportUrl */ + supportUrl?: (string|null); + + /** WindowsUpdatePackage moreInfoUrls */ + moreInfoUrls?: (string[]|null); + + /** WindowsUpdatePackage updateId */ + updateId?: (string|null); + + /** WindowsUpdatePackage revisionNumber */ + revisionNumber?: (number|null); + + /** WindowsUpdatePackage lastDeploymentChangeTime */ + lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsUpdatePackage. */ + class WindowsUpdatePackage implements IWindowsUpdatePackage { + + /** + * Constructs a new WindowsUpdatePackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage); + + /** WindowsUpdatePackage title. */ + public title: string; + + /** WindowsUpdatePackage description. */ + public description: string; + + /** WindowsUpdatePackage categories. */ + public categories: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory[]; + + /** WindowsUpdatePackage kbArticleIds. */ + public kbArticleIds: string[]; + + /** WindowsUpdatePackage supportUrl. */ + public supportUrl: string; + + /** WindowsUpdatePackage moreInfoUrls. */ + public moreInfoUrls: string[]; + + /** WindowsUpdatePackage updateId. */ + public updateId: string; + + /** WindowsUpdatePackage revisionNumber. */ + public revisionNumber: number; + + /** WindowsUpdatePackage lastDeploymentChangeTime. */ + public lastDeploymentChangeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdatePackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @param message WindowsUpdatePackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdatePackage + * @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.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdatePackage + * @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.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Verifies a WindowsUpdatePackage 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 WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdatePackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @param message WindowsUpdatePackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdatePackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WindowsUpdatePackage { + + /** Properties of a WindowsUpdateCategory. */ + interface IWindowsUpdateCategory { + + /** WindowsUpdateCategory id */ + id?: (string|null); + + /** WindowsUpdateCategory name */ + name?: (string|null); + } + + /** Represents a WindowsUpdateCategory. */ + class WindowsUpdateCategory implements IWindowsUpdateCategory { + + /** + * Constructs a new WindowsUpdateCategory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory); + + /** WindowsUpdateCategory id. */ + public id: string; + + /** WindowsUpdateCategory name. */ + public name: string; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsUpdateCategory instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @param message WindowsUpdateCategory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsUpdateCategory + * @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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsUpdateCategory + * @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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Verifies a WindowsUpdateCategory 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 WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsUpdateCategory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @param message WindowsUpdateCategory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsUpdateCategory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a WindowsQuickFixEngineeringPackage. */ + interface IWindowsQuickFixEngineeringPackage { + + /** WindowsQuickFixEngineeringPackage caption */ + caption?: (string|null); + + /** WindowsQuickFixEngineeringPackage description */ + description?: (string|null); + + /** WindowsQuickFixEngineeringPackage hotFixId */ + hotFixId?: (string|null); + + /** WindowsQuickFixEngineeringPackage installTime */ + installTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a WindowsQuickFixEngineeringPackage. */ + class WindowsQuickFixEngineeringPackage implements IWindowsQuickFixEngineeringPackage { + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage); + + /** WindowsQuickFixEngineeringPackage caption. */ + public caption: string; + + /** WindowsQuickFixEngineeringPackage description. */ + public description: string; + + /** WindowsQuickFixEngineeringPackage hotFixId. */ + public hotFixId: string; + + /** WindowsQuickFixEngineeringPackage installTime. */ + public installTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsQuickFixEngineeringPackage instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @param message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsQuickFixEngineeringPackage + * @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.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsQuickFixEngineeringPackage + * @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.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Verifies a WindowsQuickFixEngineeringPackage 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 WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsQuickFixEngineeringPackage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @param message WindowsQuickFixEngineeringPackage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsQuickFixEngineeringPackage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WindowsApplication. */ + interface IWindowsApplication { + + /** WindowsApplication displayName */ + displayName?: (string|null); + + /** WindowsApplication displayVersion */ + displayVersion?: (string|null); + + /** WindowsApplication publisher */ + publisher?: (string|null); + + /** WindowsApplication installDate */ + installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink */ + helpLink?: (string|null); + } + + /** Represents a WindowsApplication. */ + class WindowsApplication implements IWindowsApplication { + + /** + * Constructs a new WindowsApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.Inventory.IWindowsApplication); + + /** WindowsApplication displayName. */ + public displayName: string; + + /** WindowsApplication displayVersion. */ + public displayVersion: string; + + /** WindowsApplication publisher. */ + public publisher: string; + + /** WindowsApplication installDate. */ + public installDate?: (google.type.IDate|null); + + /** WindowsApplication helpLink. */ + public helpLink: string; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns WindowsApplication instance + */ + public static create(properties?: google.cloud.osconfig.v1.Inventory.IWindowsApplication): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @param message WindowsApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.Inventory.IWindowsApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WindowsApplication + * @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.osconfig.v1.Inventory.WindowsApplication; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WindowsApplication + * @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.osconfig.v1.Inventory.WindowsApplication; + + /** + * Verifies a WindowsApplication 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 WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WindowsApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.Inventory.WindowsApplication; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @param message WindowsApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.Inventory.WindowsApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WindowsApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WindowsApplication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetInventoryRequest. */ + interface IGetInventoryRequest { + + /** GetInventoryRequest name */ + name?: (string|null); + + /** GetInventoryRequest view */ + view?: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView|null); + } + + /** Represents a GetInventoryRequest. */ + class GetInventoryRequest implements IGetInventoryRequest { + + /** + * Constructs a new GetInventoryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IGetInventoryRequest); + + /** GetInventoryRequest name. */ + public name: string; + + /** GetInventoryRequest view. */ + public view: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView); + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInventoryRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IGetInventoryRequest): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @param message GetInventoryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IGetInventoryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInventoryRequest + * @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.osconfig.v1.GetInventoryRequest; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInventoryRequest + * @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.osconfig.v1.GetInventoryRequest; + + /** + * Verifies a GetInventoryRequest 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 GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInventoryRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.GetInventoryRequest; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @param message GetInventoryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.GetInventoryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInventoryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInventoryRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInventoriesRequest. */ + interface IListInventoriesRequest { + + /** ListInventoriesRequest parent */ + parent?: (string|null); + + /** ListInventoriesRequest view */ + view?: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView|null); + + /** ListInventoriesRequest pageSize */ + pageSize?: (number|null); + + /** ListInventoriesRequest pageToken */ + pageToken?: (string|null); + + /** ListInventoriesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInventoriesRequest. */ + class ListInventoriesRequest implements IListInventoriesRequest { + + /** + * Constructs a new ListInventoriesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListInventoriesRequest); + + /** ListInventoriesRequest parent. */ + public parent: string; + + /** ListInventoriesRequest view. */ + public view: (google.cloud.osconfig.v1.InventoryView|keyof typeof google.cloud.osconfig.v1.InventoryView); + + /** ListInventoriesRequest pageSize. */ + public pageSize: number; + + /** ListInventoriesRequest pageToken. */ + public pageToken: string; + + /** ListInventoriesRequest filter. */ + public filter: string; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesRequest instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListInventoriesRequest): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @param message ListInventoriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListInventoriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesRequest + * @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.osconfig.v1.ListInventoriesRequest; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesRequest + * @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.osconfig.v1.ListInventoriesRequest; + + /** + * Verifies a ListInventoriesRequest 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 ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListInventoriesRequest; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @param message ListInventoriesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListInventoriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInventoriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListInventoriesResponse. */ + interface IListInventoriesResponse { + + /** ListInventoriesResponse inventories */ + inventories?: (google.cloud.osconfig.v1.IInventory[]|null); + + /** ListInventoriesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListInventoriesResponse. */ + class ListInventoriesResponse implements IListInventoriesResponse { + + /** + * Constructs a new ListInventoriesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.osconfig.v1.IListInventoriesResponse); + + /** ListInventoriesResponse inventories. */ + public inventories: google.cloud.osconfig.v1.IInventory[]; + + /** ListInventoriesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInventoriesResponse instance + */ + public static create(properties?: google.cloud.osconfig.v1.IListInventoriesResponse): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.osconfig.v1.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @param message ListInventoriesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.osconfig.v1.IListInventoriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInventoriesResponse + * @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.osconfig.v1.ListInventoriesResponse; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInventoriesResponse + * @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.osconfig.v1.ListInventoriesResponse; + + /** + * Verifies a ListInventoriesResponse 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 ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInventoriesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.osconfig.v1.ListInventoriesResponse; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @param message ListInventoriesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.osconfig.v1.ListInventoriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInventoriesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** InventoryView enum. */ + enum InventoryView { + INVENTORY_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of a Date. */ + interface IDate { + + /** Date year */ + year?: (number|null); + + /** Date month */ + month?: (number|null); + + /** Date day */ + day?: (number|null); + } + + /** Represents a Date. */ + class Date implements IDate { + + /** + * Constructs a new Date. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IDate); + + /** Date year. */ + public year: number; + + /** Date month. */ + public month: number; + + /** Date day. */ + public day: number; + + /** + * Creates a new Date instance using the specified properties. + * @param [properties] Properties to set + * @returns Date instance + */ + public static create(properties?: google.type.IDate): google.type.Date; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @param message Date message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IDate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Date message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Date; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Date; + + /** + * Verifies a Date message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Date + */ + public static fromObject(object: { [k: string]: any }): google.type.Date; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @param message Date + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Date, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Date to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Date + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace identity. */ + namespace identity { + + /** Namespace accesscontextmanager. */ + namespace accesscontextmanager { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AccessLevel. */ + interface IAccessLevel { + + /** AccessLevel name */ + name?: (string|null); + + /** AccessLevel title */ + title?: (string|null); + + /** AccessLevel description */ + description?: (string|null); + + /** AccessLevel basic */ + basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom */ + custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AccessLevel. */ + class AccessLevel implements IAccessLevel { + + /** + * Constructs a new AccessLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessLevel); + + /** AccessLevel name. */ + public name: string; + + /** AccessLevel title. */ + public title: string; + + /** AccessLevel description. */ + public description: string; + + /** AccessLevel basic. */ + public basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom. */ + public custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel level. */ + public level?: ("basic"|"custom"); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessLevel): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Verifies an AccessLevel 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 AccessLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @param message AccessLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BasicLevel. */ + interface IBasicLevel { + + /** BasicLevel conditions */ + conditions?: (google.identity.accesscontextmanager.v1.ICondition[]|null); + + /** BasicLevel combiningFunction */ + combiningFunction?: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null); + } + + /** Represents a BasicLevel. */ + class BasicLevel implements IBasicLevel { + + /** + * Constructs a new BasicLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IBasicLevel); + + /** BasicLevel conditions. */ + public conditions: google.identity.accesscontextmanager.v1.ICondition[]; + + /** BasicLevel combiningFunction. */ + public combiningFunction: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction); + + /** + * Creates a new BasicLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IBasicLevel): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Verifies a BasicLevel 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 BasicLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @param message BasicLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.BasicLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BasicLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BasicLevel { + + /** ConditionCombiningFunction enum. */ + enum ConditionCombiningFunction { + AND = 0, + OR = 1 + } + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition ipSubnetworks */ + ipSubnetworks?: (string[]|null); + + /** Condition devicePolicy */ + devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels */ + requiredAccessLevels?: (string[]|null); + + /** Condition negate */ + negate?: (boolean|null); + + /** Condition members */ + members?: (string[]|null); + + /** Condition regions */ + regions?: (string[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICondition); + + /** Condition ipSubnetworks. */ + public ipSubnetworks: string[]; + + /** Condition devicePolicy. */ + public devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels. */ + public requiredAccessLevels: string[]; + + /** Condition negate. */ + public negate: boolean; + + /** Condition members. */ + public members: string[]; + + /** Condition regions. */ + public regions: string[]; + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICondition): google.identity.accesscontextmanager.v1.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Verifies a Condition 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 Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomLevel. */ + interface ICustomLevel { + + /** CustomLevel expr */ + expr?: (google.type.IExpr|null); + } + + /** Represents a CustomLevel. */ + class CustomLevel implements ICustomLevel { + + /** + * Constructs a new CustomLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICustomLevel); + + /** CustomLevel expr. */ + public expr?: (google.type.IExpr|null); + + /** + * Creates a new CustomLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICustomLevel): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Verifies a CustomLevel 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 CustomLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @param message CustomLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.CustomLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DevicePolicy. */ + interface IDevicePolicy { + + /** DevicePolicy requireScreenlock */ + requireScreenlock?: (boolean|null); + + /** DevicePolicy allowedEncryptionStatuses */ + allowedEncryptionStatuses?: (google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]|null); + + /** DevicePolicy osConstraints */ + osConstraints?: (google.identity.accesscontextmanager.v1.IOsConstraint[]|null); + + /** DevicePolicy allowedDeviceManagementLevels */ + allowedDeviceManagementLevels?: (google.identity.accesscontextmanager.type.DeviceManagementLevel[]|null); + + /** DevicePolicy requireAdminApproval */ + requireAdminApproval?: (boolean|null); + + /** DevicePolicy requireCorpOwned */ + requireCorpOwned?: (boolean|null); + } + + /** Represents a DevicePolicy. */ + class DevicePolicy implements IDevicePolicy { + + /** + * Constructs a new DevicePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy); + + /** DevicePolicy requireScreenlock. */ + public requireScreenlock: boolean; + + /** DevicePolicy allowedEncryptionStatuses. */ + public allowedEncryptionStatuses: google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]; + + /** DevicePolicy osConstraints. */ + public osConstraints: google.identity.accesscontextmanager.v1.IOsConstraint[]; + + /** DevicePolicy allowedDeviceManagementLevels. */ + public allowedDeviceManagementLevels: google.identity.accesscontextmanager.type.DeviceManagementLevel[]; + + /** DevicePolicy requireAdminApproval. */ + public requireAdminApproval: boolean; + + /** DevicePolicy requireCorpOwned. */ + public requireCorpOwned: boolean; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DevicePolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Verifies a DevicePolicy 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 DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DevicePolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @param message DevicePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.DevicePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DevicePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DevicePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OsConstraint. */ + interface IOsConstraint { + + /** OsConstraint osType */ + osType?: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType|null); + + /** OsConstraint minimumVersion */ + minimumVersion?: (string|null); + + /** OsConstraint requireVerifiedChromeOs */ + requireVerifiedChromeOs?: (boolean|null); + } + + /** Represents an OsConstraint. */ + class OsConstraint implements IOsConstraint { + + /** + * Constructs a new OsConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IOsConstraint); + + /** OsConstraint osType. */ + public osType: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType); + + /** OsConstraint minimumVersion. */ + public minimumVersion: string; + + /** OsConstraint requireVerifiedChromeOs. */ + public requireVerifiedChromeOs: boolean; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns OsConstraint instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IOsConstraint): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Verifies an OsConstraint 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 OsConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsConstraint + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @param message OsConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.OsConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessPolicy. */ + interface IAccessPolicy { + + /** AccessPolicy name */ + name?: (string|null); + + /** AccessPolicy parent */ + parent?: (string|null); + + /** AccessPolicy title */ + title?: (string|null); + + /** AccessPolicy scopes */ + scopes?: (string[]|null); + + /** AccessPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag */ + etag?: (string|null); + } + + /** Represents an AccessPolicy. */ + class AccessPolicy implements IAccessPolicy { + + /** + * Constructs a new AccessPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy); + + /** AccessPolicy name. */ + public name: string; + + /** AccessPolicy parent. */ + public parent: string; + + /** AccessPolicy title. */ + public title: string; + + /** AccessPolicy scopes. */ + public scopes: string[]; + + /** AccessPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag. */ + public etag: string; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Verifies an AccessPolicy 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 AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @param message AccessPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicePerimeter. */ + interface IServicePerimeter { + + /** ServicePerimeter name */ + name?: (string|null); + + /** ServicePerimeter title */ + title?: (string|null); + + /** ServicePerimeter description */ + description?: (string|null); + + /** ServicePerimeter createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType */ + perimeterType?: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null); + + /** ServicePerimeter status */ + status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec */ + spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec */ + useExplicitDryRunSpec?: (boolean|null); + } + + /** Represents a ServicePerimeter. */ + class ServicePerimeter implements IServicePerimeter { + + /** + * Constructs a new ServicePerimeter. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter); + + /** ServicePerimeter name. */ + public name: string; + + /** ServicePerimeter title. */ + public title: string; + + /** ServicePerimeter description. */ + public description: string; + + /** ServicePerimeter createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType. */ + public perimeterType: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType); + + /** ServicePerimeter status. */ + public status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec. */ + public spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec. */ + public useExplicitDryRunSpec: boolean; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeter instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Verifies a ServicePerimeter 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 ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeter + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @param message ServicePerimeter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServicePerimeter { + + /** PerimeterType enum. */ + enum PerimeterType { + PERIMETER_TYPE_REGULAR = 0, + PERIMETER_TYPE_BRIDGE = 1 + } + } + + /** Properties of a ServicePerimeterConfig. */ + interface IServicePerimeterConfig { + + /** ServicePerimeterConfig resources */ + resources?: (string[]|null); + + /** ServicePerimeterConfig accessLevels */ + accessLevels?: (string[]|null); + + /** ServicePerimeterConfig restrictedServices */ + restrictedServices?: (string[]|null); + + /** ServicePerimeterConfig vpcAccessibleServices */ + vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** ServicePerimeterConfig ingressPolicies */ + ingressPolicies?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy[]|null); + + /** ServicePerimeterConfig egressPolicies */ + egressPolicies?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy[]|null); + } + + /** Represents a ServicePerimeterConfig. */ + class ServicePerimeterConfig implements IServicePerimeterConfig { + + /** + * Constructs a new ServicePerimeterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig); + + /** ServicePerimeterConfig resources. */ + public resources: string[]; + + /** ServicePerimeterConfig accessLevels. */ + public accessLevels: string[]; + + /** ServicePerimeterConfig restrictedServices. */ + public restrictedServices: string[]; + + /** ServicePerimeterConfig vpcAccessibleServices. */ + public vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** ServicePerimeterConfig ingressPolicies. */ + public ingressPolicies: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy[]; + + /** ServicePerimeterConfig egressPolicies. */ + public egressPolicies: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy[]; + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeterConfig instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Verifies a ServicePerimeterConfig 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 ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeterConfig + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @param message ServicePerimeterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServicePerimeterConfig { + + /** Properties of a VpcAccessibleServices. */ + interface IVpcAccessibleServices { + + /** VpcAccessibleServices enableRestriction */ + enableRestriction?: (boolean|null); + + /** VpcAccessibleServices allowedServices */ + allowedServices?: (string[]|null); + } + + /** Represents a VpcAccessibleServices. */ + class VpcAccessibleServices implements IVpcAccessibleServices { + + /** + * Constructs a new VpcAccessibleServices. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices); + + /** VpcAccessibleServices enableRestriction. */ + public enableRestriction: boolean; + + /** VpcAccessibleServices allowedServices. */ + public allowedServices: string[]; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcAccessibleServices instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Verifies a VpcAccessibleServices 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 VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcAccessibleServices + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @param message VpcAccessibleServices + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcAccessibleServices + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IdentityType enum. */ + enum IdentityType { + IDENTITY_TYPE_UNSPECIFIED = 0, + ANY_IDENTITY = 1, + ANY_USER_ACCOUNT = 2, + ANY_SERVICE_ACCOUNT = 3 + } + + /** Properties of a MethodSelector. */ + interface IMethodSelector { + + /** MethodSelector method */ + method?: (string|null); + + /** MethodSelector permission */ + permission?: (string|null); + } + + /** Represents a MethodSelector. */ + class MethodSelector implements IMethodSelector { + + /** + * Constructs a new MethodSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector); + + /** MethodSelector method. */ + public method?: (string|null); + + /** MethodSelector permission. */ + public permission?: (string|null); + + /** MethodSelector kind. */ + public kind?: ("method"|"permission"); + + /** + * Creates a new MethodSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSelector instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Encodes the specified MethodSelector message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @param message MethodSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSelector message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @param message MethodSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSelector + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Decodes a MethodSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSelector + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Verifies a MethodSelector 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 MethodSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSelector + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Creates a plain object from a MethodSelector message. Also converts values to other types if specified. + * @param message MethodSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiOperation. */ + interface IApiOperation { + + /** ApiOperation serviceName */ + serviceName?: (string|null); + + /** ApiOperation methodSelectors */ + methodSelectors?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector[]|null); + } + + /** Represents an ApiOperation. */ + class ApiOperation implements IApiOperation { + + /** + * Constructs a new ApiOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation); + + /** ApiOperation serviceName. */ + public serviceName: string; + + /** ApiOperation methodSelectors. */ + public methodSelectors: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector[]; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiOperation instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiOperation + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiOperation + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Verifies an ApiOperation 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 ApiOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiOperation + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @param message ApiOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressSource. */ + interface IIngressSource { + + /** IngressSource accessLevel */ + accessLevel?: (string|null); + + /** IngressSource resource */ + resource?: (string|null); + } + + /** Represents an IngressSource. */ + class IngressSource implements IIngressSource { + + /** + * Constructs a new IngressSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource); + + /** IngressSource accessLevel. */ + public accessLevel?: (string|null); + + /** IngressSource resource. */ + public resource?: (string|null); + + /** IngressSource source. */ + public source?: ("accessLevel"|"resource"); + + /** + * Creates a new IngressSource instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressSource instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Encodes the specified IngressSource message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @param message IngressSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressSource message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @param message IngressSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressSource + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Decodes an IngressSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressSource + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Verifies an IngressSource 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 IngressSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressSource + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Creates a plain object from an IngressSource message. Also converts values to other types if specified. + * @param message IngressSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressFrom. */ + interface IIngressFrom { + + /** IngressFrom sources */ + sources?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource[]|null); + + /** IngressFrom identities */ + identities?: (string[]|null); + + /** IngressFrom identityType */ + identityType?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null); + } + + /** Represents an IngressFrom. */ + class IngressFrom implements IIngressFrom { + + /** + * Constructs a new IngressFrom. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom); + + /** IngressFrom sources. */ + public sources: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource[]; + + /** IngressFrom identities. */ + public identities: string[]; + + /** IngressFrom identityType. */ + public identityType: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType); + + /** + * Creates a new IngressFrom instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressFrom instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Encodes the specified IngressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @param message IngressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @param message IngressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressFrom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Decodes an IngressFrom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Verifies an IngressFrom 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 IngressFrom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressFrom + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Creates a plain object from an IngressFrom message. Also converts values to other types if specified. + * @param message IngressFrom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressFrom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressFrom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressTo. */ + interface IIngressTo { + + /** IngressTo operations */ + operations?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]|null); + + /** IngressTo resources */ + resources?: (string[]|null); + } + + /** Represents an IngressTo. */ + class IngressTo implements IIngressTo { + + /** + * Constructs a new IngressTo. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo); + + /** IngressTo operations. */ + public operations: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]; + + /** IngressTo resources. */ + public resources: string[]; + + /** + * Creates a new IngressTo instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressTo instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Encodes the specified IngressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @param message IngressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @param message IngressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressTo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Decodes an IngressTo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Verifies an IngressTo 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 IngressTo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressTo + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Creates a plain object from an IngressTo message. Also converts values to other types if specified. + * @param message IngressTo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressTo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressTo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressPolicy. */ + interface IIngressPolicy { + + /** IngressPolicy ingressFrom */ + ingressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null); + + /** IngressPolicy ingressTo */ + ingressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null); + } + + /** Represents an IngressPolicy. */ + class IngressPolicy implements IIngressPolicy { + + /** + * Constructs a new IngressPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy); + + /** IngressPolicy ingressFrom. */ + public ingressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null); + + /** IngressPolicy ingressTo. */ + public ingressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null); + + /** + * Creates a new IngressPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Encodes the specified IngressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @param message IngressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @param message IngressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Verifies an IngressPolicy 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 IngressPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Creates a plain object from an IngressPolicy message. Also converts values to other types if specified. + * @param message IngressPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressFrom. */ + interface IEgressFrom { + + /** EgressFrom identities */ + identities?: (string[]|null); + + /** EgressFrom identityType */ + identityType?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null); + } + + /** Represents an EgressFrom. */ + class EgressFrom implements IEgressFrom { + + /** + * Constructs a new EgressFrom. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom); + + /** EgressFrom identities. */ + public identities: string[]; + + /** EgressFrom identityType. */ + public identityType: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType); + + /** + * Creates a new EgressFrom instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressFrom instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Encodes the specified EgressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @param message EgressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @param message EgressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressFrom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Decodes an EgressFrom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Verifies an EgressFrom 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 EgressFrom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressFrom + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Creates a plain object from an EgressFrom message. Also converts values to other types if specified. + * @param message EgressFrom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressFrom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressFrom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressTo. */ + interface IEgressTo { + + /** EgressTo resources */ + resources?: (string[]|null); + + /** EgressTo operations */ + operations?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]|null); + + /** EgressTo externalResources */ + externalResources?: (string[]|null); + } + + /** Represents an EgressTo. */ + class EgressTo implements IEgressTo { + + /** + * Constructs a new EgressTo. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo); + + /** EgressTo resources. */ + public resources: string[]; + + /** EgressTo operations. */ + public operations: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]; + + /** EgressTo externalResources. */ + public externalResources: string[]; + + /** + * Creates a new EgressTo instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressTo instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Encodes the specified EgressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @param message EgressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @param message EgressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressTo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Decodes an EgressTo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Verifies an EgressTo 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 EgressTo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressTo + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Creates a plain object from an EgressTo message. Also converts values to other types if specified. + * @param message EgressTo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressTo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressTo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressPolicy. */ + interface IEgressPolicy { + + /** EgressPolicy egressFrom */ + egressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null); + + /** EgressPolicy egressTo */ + egressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null); + } + + /** Represents an EgressPolicy. */ + class EgressPolicy implements IEgressPolicy { + + /** + * Constructs a new EgressPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy); + + /** EgressPolicy egressFrom. */ + public egressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null); + + /** EgressPolicy egressTo. */ + public egressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null); + + /** + * Creates a new EgressPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Encodes the specified EgressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @param message EgressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @param message EgressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Verifies an EgressPolicy 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 EgressPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Creates a plain object from an EgressPolicy message. Also converts values to other types if specified. + * @param message EgressPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace type. */ + namespace type { + + /** DeviceEncryptionStatus enum. */ + enum DeviceEncryptionStatus { + ENCRYPTION_UNSPECIFIED = 0, + ENCRYPTION_UNSUPPORTED = 1, + UNENCRYPTED = 2, + ENCRYPTED = 3 + } + + /** OsType enum. */ + enum OsType { + OS_UNSPECIFIED = 0, + DESKTOP_MAC = 1, + DESKTOP_WINDOWS = 2, + DESKTOP_LINUX = 3, + DESKTOP_CHROME_OS = 6, + ANDROID = 4, + IOS = 5 + } + + /** DeviceManagementLevel enum. */ + enum DeviceManagementLevel { + MANAGEMENT_UNSPECIFIED = 0, + NONE = 1, + BASIC = 2, + COMPLETE = 3 + } + } + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** 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 + } + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.rpc.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations 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 Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @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.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @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.longrunning.Operation; + + /** + * Verifies an Operation 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 Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse 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 ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest 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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest 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 WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo 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 OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/protos.js b/owl-bot-staging/google-cloud-asset/v1/protos/protos.js new file mode 100644 index 00000000000..ec310b3b558 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/protos.js @@ -0,0 +1,68569 @@ +// Copyright 2024 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_asset_protos || ($protobuf.roots._google_cloud_asset_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.asset = (function() { + + /** + * Namespace asset. + * @memberof google.cloud + * @namespace + */ + var asset = {}; + + asset.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.asset + * @namespace + */ + var v1 = {}; + + v1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1 + * @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.v1.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.v1.AssetService|exportAssets}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ExportAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { + return this.rpcCall(exportAssets, $root.google.cloud.asset.v1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAssets" }); + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|listAssets}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.asset.v1.ListAssetsRequest, $root.google.cloud.asset.v1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|batchGetAssetsHistory}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef BatchGetAssetsHistoryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} [response] BatchGetAssetsHistoryResponse + */ + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.BatchGetAssetsHistoryCallback} callback Node-style callback called with the error, if any, and BatchGetAssetsHistoryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.batchGetAssetsHistory = function batchGetAssetsHistory(request, callback) { + return this.rpcCall(batchGetAssetsHistory, $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest, $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse, request, callback); + }, "name", { value: "BatchGetAssetsHistory" }); + + /** + * Calls BatchGetAssetsHistory. + * @function batchGetAssetsHistory + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} request BatchGetAssetsHistoryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|createFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef CreateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed + */ + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { + return this.rpcCall(createFeed, $root.google.cloud.asset.v1.CreateFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "CreateFeed" }); + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|getFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef GetFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed + */ + + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetFeedRequest} request GetFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { + return this.rpcCall(getFeed, $root.google.cloud.asset.v1.GetFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "GetFeed" }); + + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetFeedRequest} request GetFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|listFeeds}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ListFeedsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.ListFeedsResponse} [response] ListFeedsResponse + */ + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { + return this.rpcCall(listFeeds, $root.google.cloud.asset.v1.ListFeedsRequest, $root.google.cloud.asset.v1.ListFeedsResponse, request, callback); + }, "name", { value: "ListFeeds" }); + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|updateFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef UpdateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.Feed} [response] Feed + */ + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { + return this.rpcCall(updateFeed, $root.google.cloud.asset.v1.UpdateFeedRequest, $root.google.cloud.asset.v1.Feed, request, callback); + }, "name", { value: "UpdateFeed" }); + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|deleteFeed}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef DeleteFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { + return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFeed" }); + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|searchAllResources}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef SearchAllResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SearchAllResourcesResponse} [response] SearchAllResourcesResponse + */ + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.SearchAllResourcesCallback} callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllResources = function searchAllResources(request, callback) { + return this.rpcCall(searchAllResources, $root.google.cloud.asset.v1.SearchAllResourcesRequest, $root.google.cloud.asset.v1.SearchAllResourcesResponse, request, callback); + }, "name", { value: "SearchAllResources" }); + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|searchAllIamPolicies}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef SearchAllIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SearchAllIamPoliciesResponse} [response] SearchAllIamPoliciesResponse + */ + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.SearchAllIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllIamPolicies = function searchAllIamPolicies(request, callback) { + return this.rpcCall(searchAllIamPolicies, $root.google.cloud.asset.v1.SearchAllIamPoliciesRequest, $root.google.cloud.asset.v1.SearchAllIamPoliciesResponse, request, callback); + }, "name", { value: "SearchAllIamPolicies" }); + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeIamPolicy}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse} [response] AnalyzeIamPolicyResponse + */ + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @param {google.cloud.asset.v1.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.v1.AnalyzeIamPolicyRequest, $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse, request, callback); + }, "name", { value: "AnalyzeIamPolicy" }); + + /** + * Calls AnalyzeIamPolicy. + * @function analyzeIamPolicy + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest} request AnalyzeIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeIamPolicyLongrunning}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeIamPolicyLongrunningCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AnalyzeIamPolicyLongrunning. + * @function analyzeIamPolicyLongrunning + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest} request AnalyzeIamPolicyLongrunningRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunningCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeIamPolicyLongrunning = function analyzeIamPolicyLongrunning(request, callback) { + return this.rpcCall(analyzeIamPolicyLongrunning, $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AnalyzeIamPolicyLongrunning" }); + + /** + * Calls AnalyzeIamPolicyLongrunning. + * @function analyzeIamPolicyLongrunning + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest} request AnalyzeIamPolicyLongrunningRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeMove}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeMoveCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.AnalyzeMoveResponse} [response] AnalyzeMoveResponse + */ + + /** + * Calls AnalyzeMove. + * @function analyzeMove + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} request AnalyzeMoveRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeMoveCallback} callback Node-style callback called with the error, if any, and AnalyzeMoveResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeMove = function analyzeMove(request, callback) { + return this.rpcCall(analyzeMove, $root.google.cloud.asset.v1.AnalyzeMoveRequest, $root.google.cloud.asset.v1.AnalyzeMoveResponse, request, callback); + }, "name", { value: "AnalyzeMove" }); + + /** + * Calls AnalyzeMove. + * @function analyzeMove + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} request AnalyzeMoveRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|queryAssets}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef QueryAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.QueryAssetsResponse} [response] QueryAssetsResponse + */ + + /** + * Calls QueryAssets. + * @function queryAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IQueryAssetsRequest} request QueryAssetsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.QueryAssetsCallback} callback Node-style callback called with the error, if any, and QueryAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.queryAssets = function queryAssets(request, callback) { + return this.rpcCall(queryAssets, $root.google.cloud.asset.v1.QueryAssetsRequest, $root.google.cloud.asset.v1.QueryAssetsResponse, request, callback); + }, "name", { value: "QueryAssets" }); + + /** + * Calls QueryAssets. + * @function queryAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IQueryAssetsRequest} request QueryAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|createSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef CreateSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls CreateSavedQuery. + * @function createSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} request CreateSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.CreateSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.createSavedQuery = function createSavedQuery(request, callback) { + return this.rpcCall(createSavedQuery, $root.google.cloud.asset.v1.CreateSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "CreateSavedQuery" }); + + /** + * Calls CreateSavedQuery. + * @function createSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} request CreateSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|getSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef GetSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls GetSavedQuery. + * @function getSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} request GetSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.GetSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.getSavedQuery = function getSavedQuery(request, callback) { + return this.rpcCall(getSavedQuery, $root.google.cloud.asset.v1.GetSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "GetSavedQuery" }); + + /** + * Calls GetSavedQuery. + * @function getSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} request GetSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|listSavedQueries}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef ListSavedQueriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.ListSavedQueriesResponse} [response] ListSavedQueriesResponse + */ + + /** + * Calls ListSavedQueries. + * @function listSavedQueries + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} request ListSavedQueriesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.ListSavedQueriesCallback} callback Node-style callback called with the error, if any, and ListSavedQueriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listSavedQueries = function listSavedQueries(request, callback) { + return this.rpcCall(listSavedQueries, $root.google.cloud.asset.v1.ListSavedQueriesRequest, $root.google.cloud.asset.v1.ListSavedQueriesResponse, request, callback); + }, "name", { value: "ListSavedQueries" }); + + /** + * Calls ListSavedQueries. + * @function listSavedQueries + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} request ListSavedQueriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|updateSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef UpdateSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.SavedQuery} [response] SavedQuery + */ + + /** + * Calls UpdateSavedQuery. + * @function updateSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} request UpdateSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.UpdateSavedQueryCallback} callback Node-style callback called with the error, if any, and SavedQuery + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateSavedQuery = function updateSavedQuery(request, callback) { + return this.rpcCall(updateSavedQuery, $root.google.cloud.asset.v1.UpdateSavedQueryRequest, $root.google.cloud.asset.v1.SavedQuery, request, callback); + }, "name", { value: "UpdateSavedQuery" }); + + /** + * Calls UpdateSavedQuery. + * @function updateSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} request UpdateSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|deleteSavedQuery}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef DeleteSavedQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSavedQuery. + * @function deleteSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} request DeleteSavedQueryRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.DeleteSavedQueryCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteSavedQuery = function deleteSavedQuery(request, callback) { + return this.rpcCall(deleteSavedQuery, $root.google.cloud.asset.v1.DeleteSavedQueryRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSavedQuery" }); + + /** + * Calls DeleteSavedQuery. + * @function deleteSavedQuery + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} request DeleteSavedQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|batchGetEffectiveIamPolicies}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef BatchGetEffectiveIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} [response] BatchGetEffectiveIamPoliciesResponse + */ + + /** + * Calls BatchGetEffectiveIamPolicies. + * @function batchGetEffectiveIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} request BatchGetEffectiveIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPoliciesCallback} callback Node-style callback called with the error, if any, and BatchGetEffectiveIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.batchGetEffectiveIamPolicies = function batchGetEffectiveIamPolicies(request, callback) { + return this.rpcCall(batchGetEffectiveIamPolicies, $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest, $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse, request, callback); + }, "name", { value: "BatchGetEffectiveIamPolicies" }); + + /** + * Calls BatchGetEffectiveIamPolicies. + * @function batchGetEffectiveIamPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} request BatchGetEffectiveIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeOrgPolicies}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeOrgPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse} [response] AnalyzeOrgPoliciesResponse + */ + + /** + * Calls AnalyzeOrgPolicies. + * @function analyzeOrgPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest} request AnalyzeOrgPoliciesRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeOrgPoliciesCallback} callback Node-style callback called with the error, if any, and AnalyzeOrgPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeOrgPolicies = function analyzeOrgPolicies(request, callback) { + return this.rpcCall(analyzeOrgPolicies, $root.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest, $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse, request, callback); + }, "name", { value: "AnalyzeOrgPolicies" }); + + /** + * Calls AnalyzeOrgPolicies. + * @function analyzeOrgPolicies + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest} request AnalyzeOrgPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeOrgPolicyGovernedContainers}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeOrgPolicyGovernedContainersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse} [response] AnalyzeOrgPolicyGovernedContainersResponse + */ + + /** + * Calls AnalyzeOrgPolicyGovernedContainers. + * @function analyzeOrgPolicyGovernedContainers + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest} request AnalyzeOrgPolicyGovernedContainersRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedContainersCallback} callback Node-style callback called with the error, if any, and AnalyzeOrgPolicyGovernedContainersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeOrgPolicyGovernedContainers = function analyzeOrgPolicyGovernedContainers(request, callback) { + return this.rpcCall(analyzeOrgPolicyGovernedContainers, $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest, $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse, request, callback); + }, "name", { value: "AnalyzeOrgPolicyGovernedContainers" }); + + /** + * Calls AnalyzeOrgPolicyGovernedContainers. + * @function analyzeOrgPolicyGovernedContainers + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest} request AnalyzeOrgPolicyGovernedContainersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1.AssetService|analyzeOrgPolicyGovernedAssets}. + * @memberof google.cloud.asset.v1.AssetService + * @typedef AnalyzeOrgPolicyGovernedAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse} [response] AnalyzeOrgPolicyGovernedAssetsResponse + */ + + /** + * Calls AnalyzeOrgPolicyGovernedAssets. + * @function analyzeOrgPolicyGovernedAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest} request AnalyzeOrgPolicyGovernedAssetsRequest message or plain object + * @param {google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedAssetsCallback} callback Node-style callback called with the error, if any, and AnalyzeOrgPolicyGovernedAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.analyzeOrgPolicyGovernedAssets = function analyzeOrgPolicyGovernedAssets(request, callback) { + return this.rpcCall(analyzeOrgPolicyGovernedAssets, $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest, $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse, request, callback); + }, "name", { value: "AnalyzeOrgPolicyGovernedAssets" }); + + /** + * Calls AnalyzeOrgPolicyGovernedAssets. + * @function analyzeOrgPolicyGovernedAssets + * @memberof google.cloud.asset.v1.AssetService + * @instance + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest} request AnalyzeOrgPolicyGovernedAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1.AnalyzeIamPolicyLongrunningMetadata = (function() { + + /** + * Properties of an AnalyzeIamPolicyLongrunningMetadata. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyLongrunningMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] AnalyzeIamPolicyLongrunningMetadata createTime + */ + + /** + * Constructs a new AnalyzeIamPolicyLongrunningMetadata. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyLongrunningMetadata. + * @implements IAnalyzeIamPolicyLongrunningMetadata + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata=} [properties] Properties to set + */ + function AnalyzeIamPolicyLongrunningMetadata(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]]; + } + + /** + * AnalyzeIamPolicyLongrunningMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @instance + */ + AnalyzeIamPolicyLongrunningMetadata.prototype.createTime = null; + + /** + * Creates a new AnalyzeIamPolicyLongrunningMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} AnalyzeIamPolicyLongrunningMetadata instance + */ + AnalyzeIamPolicyLongrunningMetadata.create = function create(properties) { + return new AnalyzeIamPolicyLongrunningMetadata(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningMetadata message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata} message AnalyzeIamPolicyLongrunningMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata} message AnalyzeIamPolicyLongrunningMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} AnalyzeIamPolicyLongrunningMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} AnalyzeIamPolicyLongrunningMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyLongrunningMetadata message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyLongrunningMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates an AnalyzeIamPolicyLongrunningMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} AnalyzeIamPolicyLongrunningMetadata + */ + AnalyzeIamPolicyLongrunningMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata} message AnalyzeIamPolicyLongrunningMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyLongrunningMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.createTime = null; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this AnalyzeIamPolicyLongrunningMetadata to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyLongrunningMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningMetadata + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyLongrunningMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata"; + }; + + return AnalyzeIamPolicyLongrunningMetadata; + })(); + + v1.ExportAssetsRequest = (function() { + + /** + * Properties of an ExportAssetsRequest. + * @memberof google.cloud.asset.v1 + * @interface IExportAssetsRequest + * @property {string|null} [parent] ExportAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime + * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes + * @property {google.cloud.asset.v1.ContentType|null} [contentType] ExportAssetsRequest contentType + * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + * @property {Array.|null} [relationshipTypes] ExportAssetsRequest relationshipTypes + */ + + /** + * Constructs a new ExportAssetsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an ExportAssetsRequest. + * @implements IExportAssetsRequest + * @constructor + * @param {google.cloud.asset.v1.IExportAssetsRequest=} [properties] Properties to set + */ + function ExportAssetsRequest(properties) { + this.assetTypes = []; + this.relationshipTypes = []; + 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]]; + } + + /** + * ExportAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.parent = ""; + + /** + * ExportAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.readTime = null; + + /** + * ExportAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ExportAssetsRequest contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.contentType = 0; + + /** + * ExportAssetsRequest outputConfig. + * @member {google.cloud.asset.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.outputConfig = null; + + /** + * ExportAssetsRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.relationshipTypes = $util.emptyArray; + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.IExportAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest instance + */ + ExportAssetsRequest.create = function create(properties) { + return new ExportAssetsRequest(properties); + }; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.relationshipTypes[i]); + return writer; + }; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ExportAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } + return null; + }; + + /** + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ExportAssetsRequest} ExportAssetsRequest + */ + ExportAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1.ExportAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); + } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1.ExportAssetsRequest} message ExportAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.assetTypes = []; + object.relationshipTypes = []; + } + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } + return object; + }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ExportAssetsRequest"; + }; + + return ExportAssetsRequest; + })(); + + v1.ExportAssetsResponse = (function() { + + /** + * Properties of an ExportAssetsResponse. + * @memberof google.cloud.asset.v1 + * @interface IExportAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime + * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + * @property {google.cloud.asset.v1.IOutputResult|null} [outputResult] ExportAssetsResponse outputResult + */ + + /** + * Constructs a new ExportAssetsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an ExportAssetsResponse. + * @implements IExportAssetsResponse + * @constructor + * @param {google.cloud.asset.v1.IExportAssetsResponse=} [properties] Properties to set + */ + function ExportAssetsResponse(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]]; + } + + /** + * ExportAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.readTime = null; + + /** + * ExportAssetsResponse outputConfig. + * @member {google.cloud.asset.v1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputConfig = null; + + /** + * ExportAssetsResponse outputResult. + * @member {google.cloud.asset.v1.IOutputResult|null|undefined} outputResult + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputResult = null; + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse instance + */ + ExportAssetsResponse.create = function create(properties) { + return new ExportAssetsResponse(properties); + }; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputResult != null && Object.hasOwnProperty.call(message, "outputResult")) + $root.google.cloud.asset.v1.OutputResult.encode(message.outputResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ExportAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ExportAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputResult = $root.google.cloud.asset.v1.OutputResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.outputResult != null && message.hasOwnProperty("outputResult")) { + var error = $root.google.cloud.asset.v1.OutputResult.verify(message.outputResult); + if (error) + return "outputResult." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ExportAssetsResponse} ExportAssetsResponse + */ + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ExportAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); + } + if (object.outputResult != null) { + if (typeof object.outputResult !== "object") + throw TypeError(".google.cloud.asset.v1.ExportAssetsResponse.outputResult: object expected"); + message.outputResult = $root.google.cloud.asset.v1.OutputResult.fromObject(object.outputResult); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1.ExportAssetsResponse} message ExportAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readTime = null; + object.outputConfig = null; + object.outputResult = null; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.outputResult != null && message.hasOwnProperty("outputResult")) + object.outputResult = $root.google.cloud.asset.v1.OutputResult.toObject(message.outputResult, options); + return object; + }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ExportAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ExportAssetsResponse"; + }; + + return ExportAssetsResponse; + })(); + + v1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.asset.v1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {Array.|null} [assetTypes] ListAssetsRequest assetTypes + * @property {google.cloud.asset.v1.ContentType|null} [contentType] ListAssetsRequest contentType + * @property {number|null} [pageSize] ListAssetsRequest pageSize + * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {Array.|null} [relationshipTypes] ListAssetsRequest relationshipTypes + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.asset.v1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(properties) { + this.assetTypes = []; + this.relationshipTypes = []; + 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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ListAssetsRequest contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.contentType = 0; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * ListAssetsRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.relationshipTypes = $util.emptyArray; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.relationshipTypes[i]); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 7: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } + return null; + }; + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.ListAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.ListAssetsRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.assetTypes = []; + object.relationshipTypes = []; + } + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListAssetsRequest"; + }; + + return ListAssetsRequest; + })(); + + v1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.asset.v1 + * @interface IListAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {Array.|null} [assets] ListAssetsResponse assets + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.asset.v1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.assets = $util.emptyArray; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1.Asset.encode(message.assets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1.ListAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1.ListAssetsResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ListAssetsResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1.Asset.fromObject(object.assets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1.Asset.toObject(message.assets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListAssetsResponse"; + }; + + return ListAssetsResponse; + })(); + + v1.BatchGetAssetsHistoryRequest = (function() { + + /** + * Properties of a BatchGetAssetsHistoryRequest. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetAssetsHistoryRequest + * @property {string|null} [parent] BatchGetAssetsHistoryRequest parent + * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames + * @property {google.cloud.asset.v1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType + * @property {google.cloud.asset.v1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + * @property {Array.|null} [relationshipTypes] BatchGetAssetsHistoryRequest relationshipTypes + */ + + /** + * Constructs a new BatchGetAssetsHistoryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetAssetsHistoryRequest. + * @implements IBatchGetAssetsHistoryRequest + * @constructor + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + */ + function BatchGetAssetsHistoryRequest(properties) { + this.assetNames = []; + this.relationshipTypes = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.parent = ""; + + /** + * BatchGetAssetsHistoryRequest assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.assetNames = $util.emptyArray; + + /** + * BatchGetAssetsHistoryRequest contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.contentType = 0; + + /** + * BatchGetAssetsHistoryRequest readTimeWindow. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} readTimeWindow + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + + /** + * BatchGetAssetsHistoryRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.relationshipTypes = $util.emptyArray; + + /** + * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest instance + */ + BatchGetAssetsHistoryRequest.create = function create(properties) { + return new BatchGetAssetsHistoryRequest(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); + if (message.readTimeWindow != null && Object.hasOwnProperty.call(message, "readTimeWindow")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.relationshipTypes[i]); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + } + case 3: { + message.contentType = reader.int32(); + break; + } + case 4: { + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.readTimeWindow); + if (error) + return "readTimeWindow." + error; + } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} BatchGetAssetsHistoryRequest + */ + BatchGetAssetsHistoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; + } + if (object.readTimeWindow != null) { + if (typeof object.readTimeWindow !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.readTimeWindow); + } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryRequest} message BatchGetAssetsHistoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.relationshipTypes = []; + } + if (options.defaults) { + object.parent = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.readTimeWindow = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) + object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchGetAssetsHistoryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetAssetsHistoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetAssetsHistoryRequest"; + }; + + return BatchGetAssetsHistoryRequest; + })(); + + v1.BatchGetAssetsHistoryResponse = (function() { + + /** + * Properties of a BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetAssetsHistoryResponse + * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + */ + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetAssetsHistoryResponse. + * @implements IBatchGetAssetsHistoryResponse + * @constructor + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + */ + function BatchGetAssetsHistoryResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @instance + */ + BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + */ + BatchGetAssetsHistoryResponse.create = function create(properties) { + return new BatchGetAssetsHistoryResponse(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.TemporalAsset.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryResponse message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1.TemporalAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + */ + BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetAssetsHistoryResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1.TemporalAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1.TemporalAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchGetAssetsHistoryResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetAssetsHistoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetAssetsHistoryResponse"; + }; + + return BatchGetAssetsHistoryResponse; + })(); + + v1.CreateFeedRequest = (function() { + + /** + * Properties of a CreateFeedRequest. + * @memberof google.cloud.asset.v1 + * @interface ICreateFeedRequest + * @property {string|null} [parent] CreateFeedRequest parent + * @property {string|null} [feedId] CreateFeedRequest feedId + * @property {google.cloud.asset.v1.IFeed|null} [feed] CreateFeedRequest feed + */ + + /** + * Constructs a new CreateFeedRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a CreateFeedRequest. + * @implements ICreateFeedRequest + * @constructor + * @param {google.cloud.asset.v1.ICreateFeedRequest=} [properties] Properties to set + */ + function CreateFeedRequest(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]]; + } + + /** + * CreateFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.parent = ""; + + /** + * CreateFeedRequest feedId. + * @member {string} feedId + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feedId = ""; + + /** + * CreateFeedRequest feed. + * @member {google.cloud.asset.v1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feed = null; + + /** + * Creates a new CreateFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.ICreateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest instance + */ + CreateFeedRequest.create = function create(properties) { + return new CreateFeedRequest(properties); + }; + + /** + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.feedId != null && Object.hasOwnProperty.call(message, "feedId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); + if (message.feed != null && Object.hasOwnProperty.call(message, "feed")) + $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFeedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.CreateFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.feedId = reader.string(); + break; + } + case 3: { + message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.feedId != null && message.hasOwnProperty("feedId")) + if (!$util.isString(message.feedId)) + return "feedId: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } + return null; + }; + + /** + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.CreateFeedRequest} CreateFeedRequest + */ + CreateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.CreateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.CreateFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.feedId != null) + message.feedId = String(object.feedId); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1.CreateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1.Feed.fromObject(object.feed); + } + return message; + }; + + /** + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1.CreateFeedRequest} message CreateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.feedId = ""; + object.feed = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.feedId != null && message.hasOwnProperty("feedId")) + object.feedId = message.feedId; + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1.Feed.toObject(message.feed, options); + return object; + }; + + /** + * Converts this CreateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.CreateFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.CreateFeedRequest"; + }; + + return CreateFeedRequest; + })(); + + v1.GetFeedRequest = (function() { + + /** + * Properties of a GetFeedRequest. + * @memberof google.cloud.asset.v1 + * @interface IGetFeedRequest + * @property {string|null} [name] GetFeedRequest name + */ + + /** + * Constructs a new GetFeedRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GetFeedRequest. + * @implements IGetFeedRequest + * @constructor + * @param {google.cloud.asset.v1.IGetFeedRequest=} [properties] Properties to set + */ + function GetFeedRequest(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]]; + } + + /** + * GetFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.GetFeedRequest + * @instance + */ + GetFeedRequest.prototype.name = ""; + + /** + * Creates a new GetFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1.IGetFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest instance + */ + GetFeedRequest.create = function create(properties) { + return new GetFeedRequest(properties); + }; + + /** + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFeedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.GetFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GetFeedRequest} GetFeedRequest + */ + GetFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GetFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.GetFeedRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1.GetFeedRequest} message GetFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GetFeedRequest + * @instance + * @returns {Object.} JSON object + */ + GetFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.GetFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.GetFeedRequest"; + }; + + return GetFeedRequest; + })(); + + v1.ListFeedsRequest = (function() { + + /** + * Properties of a ListFeedsRequest. + * @memberof google.cloud.asset.v1 + * @interface IListFeedsRequest + * @property {string|null} [parent] ListFeedsRequest parent + */ + + /** + * Constructs a new ListFeedsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListFeedsRequest. + * @implements IListFeedsRequest + * @constructor + * @param {google.cloud.asset.v1.IListFeedsRequest=} [properties] Properties to set + */ + function ListFeedsRequest(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]]; + } + + /** + * ListFeedsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @instance + */ + ListFeedsRequest.prototype.parent = ""; + + /** + * Creates a new ListFeedsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1.IListFeedsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest instance + */ + ListFeedsRequest.create = function create(properties) { + return new ListFeedsRequest(properties); + }; + + /** + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListFeedsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFeedsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFeedsRequest.verify = function verify(message) { + 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"; + return null; + }; + + /** + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListFeedsRequest} ListFeedsRequest + */ + ListFeedsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListFeedsRequest) + return object; + var message = new $root.google.cloud.asset.v1.ListFeedsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1.ListFeedsRequest} message ListFeedsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFeedsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListFeedsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFeedsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFeedsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListFeedsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFeedsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListFeedsRequest"; + }; + + return ListFeedsRequest; + })(); + + v1.ListFeedsResponse = (function() { + + /** + * Properties of a ListFeedsResponse. + * @memberof google.cloud.asset.v1 + * @interface IListFeedsResponse + * @property {Array.|null} [feeds] ListFeedsResponse feeds + */ + + /** + * Constructs a new ListFeedsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListFeedsResponse. + * @implements IListFeedsResponse + * @constructor + * @param {google.cloud.asset.v1.IListFeedsResponse=} [properties] Properties to set + */ + function ListFeedsResponse(properties) { + this.feeds = []; + 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]]; + } + + /** + * ListFeedsResponse feeds. + * @member {Array.} feeds + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @instance + */ + ListFeedsResponse.prototype.feeds = $util.emptyArray; + + /** + * Creates a new ListFeedsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1.IListFeedsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse instance + */ + ListFeedsResponse.create = function create(properties) { + return new ListFeedsResponse(properties); + }; + + /** + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.asset.v1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListFeedsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListFeedsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFeedsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFeedsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feeds[i]); + if (error) + return "feeds." + error; + } + } + return null; + }; + + /** + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListFeedsResponse} ListFeedsResponse + */ + ListFeedsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListFeedsResponse) + return object; + var message = new $root.google.cloud.asset.v1.ListFeedsResponse(); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.asset.v1.ListFeedsResponse.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ListFeedsResponse.feeds: object expected"); + message.feeds[i] = $root.google.cloud.asset.v1.Feed.fromObject(object.feeds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1.ListFeedsResponse} message ListFeedsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFeedsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.feeds = []; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.asset.v1.Feed.toObject(message.feeds[j], options); + } + return object; + }; + + /** + * Converts this ListFeedsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFeedsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFeedsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListFeedsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFeedsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListFeedsResponse"; + }; + + return ListFeedsResponse; + })(); + + v1.UpdateFeedRequest = (function() { + + /** + * Properties of an UpdateFeedRequest. + * @memberof google.cloud.asset.v1 + * @interface IUpdateFeedRequest + * @property {google.cloud.asset.v1.IFeed|null} [feed] UpdateFeedRequest feed + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask + */ + + /** + * Constructs a new UpdateFeedRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an UpdateFeedRequest. + * @implements IUpdateFeedRequest + * @constructor + * @param {google.cloud.asset.v1.IUpdateFeedRequest=} [properties] Properties to set + */ + function UpdateFeedRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFeedRequest feed. + * @member {google.cloud.asset.v1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.feed = null; + + /** + * UpdateFeedRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1.IUpdateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest instance + */ + UpdateFeedRequest.create = function create(properties) { + return new UpdateFeedRequest(properties); + }; + + /** + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feed != null && Object.hasOwnProperty.call(message, "feed")) + $root.google.cloud.asset.v1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.UpdateFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.feed = $root.google.cloud.asset.v1.Feed.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.UpdateFeedRequest} UpdateFeedRequest + */ + UpdateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.UpdateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.UpdateFeedRequest(); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1.Feed.fromObject(object.feed); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateFeedRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1.UpdateFeedRequest} message UpdateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.feed = null; + object.updateMask = null; + } + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1.Feed.toObject(message.feed, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.UpdateFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.UpdateFeedRequest"; + }; + + return UpdateFeedRequest; + })(); + + v1.DeleteFeedRequest = (function() { + + /** + * Properties of a DeleteFeedRequest. + * @memberof google.cloud.asset.v1 + * @interface IDeleteFeedRequest + * @property {string|null} [name] DeleteFeedRequest name + */ + + /** + * Constructs a new DeleteFeedRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a DeleteFeedRequest. + * @implements IDeleteFeedRequest + * @constructor + * @param {google.cloud.asset.v1.IDeleteFeedRequest=} [properties] Properties to set + */ + function DeleteFeedRequest(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]]; + } + + /** + * DeleteFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @instance + */ + DeleteFeedRequest.prototype.name = ""; + + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1.IDeleteFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest instance + */ + DeleteFeedRequest.create = function create(properties) { + return new DeleteFeedRequest(properties); + }; + + /** + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFeedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.DeleteFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.DeleteFeedRequest} DeleteFeedRequest + */ + DeleteFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.DeleteFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1.DeleteFeedRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1.DeleteFeedRequest} message DeleteFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.DeleteFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.DeleteFeedRequest"; + }; + + return DeleteFeedRequest; + })(); + + v1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.asset.v1 + * @interface IOutputConfig + * @property {google.cloud.asset.v1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.asset.v1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(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]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + OutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.asset.v1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.asset.v1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + 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.v1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.OutputConfig) + return object; + var message = new $root.google.cloud.asset.v1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.OutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {google.cloud.asset.v1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1.OutputResult = (function() { + + /** + * Properties of an OutputResult. + * @memberof google.cloud.asset.v1 + * @interface IOutputResult + * @property {google.cloud.asset.v1.IGcsOutputResult|null} [gcsResult] OutputResult gcsResult + */ + + /** + * Constructs a new OutputResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an OutputResult. + * @implements IOutputResult + * @constructor + * @param {google.cloud.asset.v1.IOutputResult=} [properties] Properties to set + */ + function OutputResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputResult gcsResult. + * @member {google.cloud.asset.v1.IGcsOutputResult|null|undefined} gcsResult + * @memberof google.cloud.asset.v1.OutputResult + * @instance + */ + OutputResult.prototype.gcsResult = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputResult result. + * @member {"gcsResult"|undefined} result + * @memberof google.cloud.asset.v1.OutputResult + * @instance + */ + Object.defineProperty(OutputResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["gcsResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.OutputResult} OutputResult instance + */ + OutputResult.create = function create(properties) { + return new OutputResult(properties); + }; + + /** + * Encodes the specified OutputResult message. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult} message OutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsResult != null && Object.hasOwnProperty.call(message, "gcsResult")) + $root.google.cloud.asset.v1.GcsOutputResult.encode(message.gcsResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.OutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.IOutputResult} message OutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.OutputResult} OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.OutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.OutputResult} OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputResult message. + * @function verify + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + properties.result = 1; + { + var error = $root.google.cloud.asset.v1.GcsOutputResult.verify(message.gcsResult); + if (error) + return "gcsResult." + error; + } + } + return null; + }; + + /** + * Creates an OutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.OutputResult} OutputResult + */ + OutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.OutputResult) + return object; + var message = new $root.google.cloud.asset.v1.OutputResult(); + if (object.gcsResult != null) { + if (typeof object.gcsResult !== "object") + throw TypeError(".google.cloud.asset.v1.OutputResult.gcsResult: object expected"); + message.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.fromObject(object.gcsResult); + } + return message; + }; + + /** + * Creates a plain object from an OutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {google.cloud.asset.v1.OutputResult} message OutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + object.gcsResult = $root.google.cloud.asset.v1.GcsOutputResult.toObject(message.gcsResult, options); + if (options.oneofs) + object.result = "gcsResult"; + } + return object; + }; + + /** + * Converts this OutputResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.OutputResult + * @instance + * @returns {Object.} JSON object + */ + OutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.OutputResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.OutputResult"; + }; + + return OutputResult; + })(); + + v1.GcsOutputResult = (function() { + + /** + * Properties of a GcsOutputResult. + * @memberof google.cloud.asset.v1 + * @interface IGcsOutputResult + * @property {Array.|null} [uris] GcsOutputResult uris + */ + + /** + * Constructs a new GcsOutputResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GcsOutputResult. + * @implements IGcsOutputResult + * @constructor + * @param {google.cloud.asset.v1.IGcsOutputResult=} [properties] Properties to set + */ + function GcsOutputResult(properties) { + this.uris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsOutputResult uris. + * @member {Array.} uris + * @memberof google.cloud.asset.v1.GcsOutputResult + * @instance + */ + GcsOutputResult.prototype.uris = $util.emptyArray; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult instance + */ + GcsOutputResult.create = function create(properties) { + return new GcsOutputResult(properties); + }; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsOutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.GcsOutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsOutputResult message. + * @function verify + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsOutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GcsOutputResult} GcsOutputResult + */ + GcsOutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GcsOutputResult) + return object; + var message = new $root.google.cloud.asset.v1.GcsOutputResult(); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.asset.v1.GcsOutputResult.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1.GcsOutputResult} message GcsOutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsOutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uris = []; + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this GcsOutputResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GcsOutputResult + * @instance + * @returns {Object.} JSON object + */ + GcsOutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsOutputResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.GcsOutputResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsOutputResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.GcsOutputResult"; + }; + + return GcsOutputResult; + })(); + + v1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1.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|null|undefined} uri + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = null; + + /** + * GcsDestination uriPrefix. + * @member {string|null|undefined} uriPrefix + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + GcsDestination.prototype.uriPrefix = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcsDestination objectUri. + * @member {"uri"|"uriPrefix"|undefined} objectUri + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && Object.hasOwnProperty.call(message, "uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.uriPrefix = 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.v1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; + } + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {google.cloud.asset.v1.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 (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; + } + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1 + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [table] BigQueryDestination table + * @property {boolean|null} [force] BigQueryDestination force + * @property {google.cloud.asset.v1.IPartitionSpec|null} [partitionSpec] BigQueryDestination partitionSpec + * @property {boolean|null} [separateTablesPerAssetType] BigQueryDestination separateTablesPerAssetType + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * BigQueryDestination table. + * @member {string} table + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.table = ""; + + /** + * BigQueryDestination force. + * @member {boolean} force + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.force = false; + + /** + * BigQueryDestination partitionSpec. + * @member {google.cloud.asset.v1.IPartitionSpec|null|undefined} partitionSpec + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.partitionSpec = null; + + /** + * BigQueryDestination separateTablesPerAssetType. + * @member {boolean} separateTablesPerAssetType + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.separateTablesPerAssetType = false; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.partitionSpec != null && Object.hasOwnProperty.call(message, "partitionSpec")) + $root.google.cloud.asset.v1.PartitionSpec.encode(message.partitionSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.separateTablesPerAssetType != null && Object.hasOwnProperty.call(message, "separateTablesPerAssetType")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.separateTablesPerAssetType); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.table = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + case 4: { + message.partitionSpec = $root.google.cloud.asset.v1.PartitionSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.separateTablesPerAssetType = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.partitionSpec != null && message.hasOwnProperty("partitionSpec")) { + var error = $root.google.cloud.asset.v1.PartitionSpec.verify(message.partitionSpec); + if (error) + return "partitionSpec." + error; + } + if (message.separateTablesPerAssetType != null && message.hasOwnProperty("separateTablesPerAssetType")) + if (typeof message.separateTablesPerAssetType !== "boolean") + return "separateTablesPerAssetType: boolean expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BigQueryDestination) + return object; + var message = new $root.google.cloud.asset.v1.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.table != null) + message.table = String(object.table); + if (object.force != null) + message.force = Boolean(object.force); + if (object.partitionSpec != null) { + if (typeof object.partitionSpec !== "object") + throw TypeError(".google.cloud.asset.v1.BigQueryDestination.partitionSpec: object expected"); + message.partitionSpec = $root.google.cloud.asset.v1.PartitionSpec.fromObject(object.partitionSpec); + } + if (object.separateTablesPerAssetType != null) + message.separateTablesPerAssetType = Boolean(object.separateTablesPerAssetType); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.table = ""; + object.force = false; + object.partitionSpec = null; + object.separateTablesPerAssetType = false; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.partitionSpec != null && message.hasOwnProperty("partitionSpec")) + object.partitionSpec = $root.google.cloud.asset.v1.PartitionSpec.toObject(message.partitionSpec, options); + if (message.separateTablesPerAssetType != null && message.hasOwnProperty("separateTablesPerAssetType")) + object.separateTablesPerAssetType = message.separateTablesPerAssetType; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BigQueryDestination"; + }; + + return BigQueryDestination; + })(); + + v1.PartitionSpec = (function() { + + /** + * Properties of a PartitionSpec. + * @memberof google.cloud.asset.v1 + * @interface IPartitionSpec + * @property {google.cloud.asset.v1.PartitionSpec.PartitionKey|null} [partitionKey] PartitionSpec partitionKey + */ + + /** + * Constructs a new PartitionSpec. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a PartitionSpec. + * @implements IPartitionSpec + * @constructor + * @param {google.cloud.asset.v1.IPartitionSpec=} [properties] Properties to set + */ + function PartitionSpec(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]]; + } + + /** + * PartitionSpec partitionKey. + * @member {google.cloud.asset.v1.PartitionSpec.PartitionKey} partitionKey + * @memberof google.cloud.asset.v1.PartitionSpec + * @instance + */ + PartitionSpec.prototype.partitionKey = 0; + + /** + * Creates a new PartitionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {google.cloud.asset.v1.IPartitionSpec=} [properties] Properties to set + * @returns {google.cloud.asset.v1.PartitionSpec} PartitionSpec instance + */ + PartitionSpec.create = function create(properties) { + return new PartitionSpec(properties); + }; + + /** + * Encodes the specified PartitionSpec message. Does not implicitly {@link google.cloud.asset.v1.PartitionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {google.cloud.asset.v1.IPartitionSpec} message PartitionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionKey != null && Object.hasOwnProperty.call(message, "partitionKey")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partitionKey); + return writer; + }; + + /** + * Encodes the specified PartitionSpec message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PartitionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {google.cloud.asset.v1.IPartitionSpec} message PartitionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.PartitionSpec} PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.PartitionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.partitionKey = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.PartitionSpec} PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionSpec message. + * @function verify + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + switch (message.partitionKey) { + default: + return "partitionKey: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PartitionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.PartitionSpec} PartitionSpec + */ + PartitionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.PartitionSpec) + return object; + var message = new $root.google.cloud.asset.v1.PartitionSpec(); + switch (object.partitionKey) { + default: + if (typeof object.partitionKey === "number") { + message.partitionKey = object.partitionKey; + break; + } + break; + case "PARTITION_KEY_UNSPECIFIED": + case 0: + message.partitionKey = 0; + break; + case "READ_TIME": + case 1: + message.partitionKey = 1; + break; + case "REQUEST_TIME": + case 2: + message.partitionKey = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PartitionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {google.cloud.asset.v1.PartitionSpec} message PartitionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.partitionKey = options.enums === String ? "PARTITION_KEY_UNSPECIFIED" : 0; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.PartitionSpec.PartitionKey[message.partitionKey] === undefined ? message.partitionKey : $root.google.cloud.asset.v1.PartitionSpec.PartitionKey[message.partitionKey] : message.partitionKey; + return object; + }; + + /** + * Converts this PartitionSpec to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.PartitionSpec + * @instance + * @returns {Object.} JSON object + */ + PartitionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionSpec + * @function getTypeUrl + * @memberof google.cloud.asset.v1.PartitionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.PartitionSpec"; + }; + + /** + * PartitionKey enum. + * @name google.cloud.asset.v1.PartitionSpec.PartitionKey + * @enum {number} + * @property {number} PARTITION_KEY_UNSPECIFIED=0 PARTITION_KEY_UNSPECIFIED value + * @property {number} READ_TIME=1 READ_TIME value + * @property {number} REQUEST_TIME=2 REQUEST_TIME value + */ + PartitionSpec.PartitionKey = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_KEY_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_TIME"] = 1; + values[valuesById[2] = "REQUEST_TIME"] = 2; + return values; + })(); + + return PartitionSpec; + })(); + + v1.PubsubDestination = (function() { + + /** + * Properties of a PubsubDestination. + * @memberof google.cloud.asset.v1 + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic + */ + + /** + * Constructs a new PubsubDestination. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination + * @constructor + * @param {google.cloud.asset.v1.IPubsubDestination=} [properties] Properties to set + */ + function PubsubDestination(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]]; + } + + /** + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.asset.v1.PubsubDestination + * @instance + */ + PubsubDestination.prototype.topic = ""; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {google.cloud.asset.v1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination instance + */ + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); + }; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {google.cloud.asset.v1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.PubsubDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {google.cloud.asset.v1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.PubsubDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubDestination message. + * @function verify + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.PubsubDestination} PubsubDestination + */ + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.PubsubDestination) + return object; + var message = new $root.google.cloud.asset.v1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {google.cloud.asset.v1.PubsubDestination} message PubsubDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this PubsubDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.PubsubDestination + * @instance + * @returns {Object.} JSON object + */ + PubsubDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.PubsubDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.PubsubDestination"; + }; + + return PubsubDestination; + })(); + + v1.FeedOutputConfig = (function() { + + /** + * Properties of a FeedOutputConfig. + * @memberof google.cloud.asset.v1 + * @interface IFeedOutputConfig + * @property {google.cloud.asset.v1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination + */ + + /** + * Constructs a new FeedOutputConfig. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a FeedOutputConfig. + * @implements IFeedOutputConfig + * @constructor + * @param {google.cloud.asset.v1.IFeedOutputConfig=} [properties] Properties to set + */ + function FeedOutputConfig(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]]; + } + + /** + * FeedOutputConfig pubsubDestination. + * @member {google.cloud.asset.v1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @instance + */ + FeedOutputConfig.prototype.pubsubDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FeedOutputConfig destination. + * @member {"pubsubDestination"|undefined} destination + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @instance + */ + Object.defineProperty(FeedOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1.IFeedOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig instance + */ + FeedOutputConfig.create = function create(properties) { + return new FeedOutputConfig(properties); + }; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeedOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubDestination != null && Object.hasOwnProperty.call(message, "pubsubDestination")) + $root.google.cloud.asset.v1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.FeedOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeedOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.FeedOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeedOutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeedOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + error; + } + } + return null; + }; + + /** + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.FeedOutputConfig} FeedOutputConfig + */ + FeedOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.FeedOutputConfig) + return object; + var message = new $root.google.cloud.asset.v1.FeedOutputConfig(); + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.asset.v1.FeedOutputConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.fromObject(object.pubsubDestination); + } + return message; + }; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1.FeedOutputConfig} message FeedOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeedOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + object.pubsubDestination = $root.google.cloud.asset.v1.PubsubDestination.toObject(message.pubsubDestination, options); + if (options.oneofs) + object.destination = "pubsubDestination"; + } + return object; + }; + + /** + * Converts this FeedOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @instance + * @returns {Object.} JSON object + */ + FeedOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeedOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1.FeedOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeedOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.FeedOutputConfig"; + }; + + return FeedOutputConfig; + })(); + + v1.Feed = (function() { + + /** + * Properties of a Feed. + * @memberof google.cloud.asset.v1 + * @interface IFeed + * @property {string|null} [name] Feed name + * @property {Array.|null} [assetNames] Feed assetNames + * @property {Array.|null} [assetTypes] Feed assetTypes + * @property {google.cloud.asset.v1.ContentType|null} [contentType] Feed contentType + * @property {google.cloud.asset.v1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig + * @property {google.type.IExpr|null} [condition] Feed condition + * @property {Array.|null} [relationshipTypes] Feed relationshipTypes + */ + + /** + * Constructs a new Feed. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Feed. + * @implements IFeed + * @constructor + * @param {google.cloud.asset.v1.IFeed=} [properties] Properties to set + */ + function Feed(properties) { + this.assetNames = []; + this.assetTypes = []; + this.relationshipTypes = []; + 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]]; + } + + /** + * Feed name. + * @member {string} name + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.name = ""; + + /** + * Feed assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.assetNames = $util.emptyArray; + + /** + * Feed assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.assetTypes = $util.emptyArray; + + /** + * Feed contentType. + * @member {google.cloud.asset.v1.ContentType} contentType + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.contentType = 0; + + /** + * Feed feedOutputConfig. + * @member {google.cloud.asset.v1.IFeedOutputConfig|null|undefined} feedOutputConfig + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.feedOutputConfig = null; + + /** + * Feed condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.condition = null; + + /** + * Feed relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.relationshipTypes = $util.emptyArray; + + /** + * Creates a new Feed instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {google.cloud.asset.v1.IFeed=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Feed} Feed instance + */ + Feed.create = function create(properties) { + return new Feed(properties); + }; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {google.cloud.asset.v1.IFeed} message Feed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.feedOutputConfig != null && Object.hasOwnProperty.call(message, "feedOutputConfig")) + $root.google.cloud.asset.v1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.relationshipTypes[i]); + return writer; + }; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Feed.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {google.cloud.asset.v1.IFeed} message Feed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Feed} Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feed.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Feed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + case 7: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Feed} Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Feed message. + * @function verify + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Feed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { + var error = $root.google.cloud.asset.v1.FeedOutputConfig.verify(message.feedOutputConfig); + if (error) + return "feedOutputConfig." + error; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } + return null; + }; + + /** + * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Feed} Feed + */ + Feed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Feed) + return object; + var message = new $root.google.cloud.asset.v1.Feed(); + if (object.name != null) + message.name = String(object.name); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1.Feed.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.Feed.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + case "OS_INVENTORY": + case 6: + message.contentType = 6; + break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; + } + if (object.feedOutputConfig != null) { + if (typeof object.feedOutputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.Feed.feedOutputConfig: object expected"); + message.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.fromObject(object.feedOutputConfig); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.asset.v1.Feed.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.Feed.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {google.cloud.asset.v1.Feed} message Feed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Feed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.assetTypes = []; + object.relationshipTypes = []; + } + if (options.defaults) { + object.name = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.feedOutputConfig = null; + object.condition = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + object.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.toObject(message.feedOutputConfig, options); + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } + return object; + }; + + /** + * Converts this Feed to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Feed + * @instance + * @returns {Object.} JSON object + */ + Feed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Feed + * @function getTypeUrl + * @memberof google.cloud.asset.v1.Feed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Feed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.Feed"; + }; + + return Feed; + })(); + + v1.SearchAllResourcesRequest = (function() { + + /** + * Properties of a SearchAllResourcesRequest. + * @memberof google.cloud.asset.v1 + * @interface ISearchAllResourcesRequest + * @property {string|null} [scope] SearchAllResourcesRequest scope + * @property {string|null} [query] SearchAllResourcesRequest query + * @property {Array.|null} [assetTypes] SearchAllResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize + * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken + * @property {string|null} [orderBy] SearchAllResourcesRequest orderBy + * @property {google.protobuf.IFieldMask|null} [readMask] SearchAllResourcesRequest readMask + */ + + /** + * Constructs a new SearchAllResourcesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a SearchAllResourcesRequest. + * @implements ISearchAllResourcesRequest + * @constructor + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest=} [properties] Properties to set + */ + function SearchAllResourcesRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * SearchAllResourcesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.scope = ""; + + /** + * SearchAllResourcesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.query = ""; + + /** + * SearchAllResourcesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.assetTypes = $util.emptyArray; + + /** + * SearchAllResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.pageSize = 0; + + /** + * SearchAllResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.pageToken = ""; + + /** + * SearchAllResourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.orderBy = ""; + + /** + * SearchAllResourcesRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.readMask = null; + + /** + * Creates a new SearchAllResourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SearchAllResourcesRequest} SearchAllResourcesRequest instance + */ + SearchAllResourcesRequest.create = function create(properties) { + return new SearchAllResourcesRequest(properties); + }; + + /** + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {google.cloud.asset.v1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.SearchAllResourcesRequest} SearchAllResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllResourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SearchAllResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + case 8: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.SearchAllResourcesRequest} SearchAllResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllResourcesRequest message. + * @function verify + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + return null; + }; + + /** + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.SearchAllResourcesRequest} SearchAllResourcesRequest + */ + SearchAllResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SearchAllResourcesRequest) + return object; + var message = new $root.google.cloud.asset.v1.SearchAllResourcesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.SearchAllResourcesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.asset.v1.SearchAllResourcesRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + return message; + }; + + /** + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {google.cloud.asset.v1.SearchAllResourcesRequest} message SearchAllResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.readMask = null; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + return object; + }; + + /** + * Converts this SearchAllResourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAllResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SearchAllResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SearchAllResourcesRequest"; + }; + + return SearchAllResourcesRequest; + })(); + + v1.SearchAllResourcesResponse = (function() { + + /** + * Properties of a SearchAllResourcesResponse. + * @memberof google.cloud.asset.v1 + * @interface ISearchAllResourcesResponse + * @property {Array.|null} [results] SearchAllResourcesResponse results + * @property {string|null} [nextPageToken] SearchAllResourcesResponse nextPageToken + */ + + /** + * Constructs a new SearchAllResourcesResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a SearchAllResourcesResponse. + * @implements ISearchAllResourcesResponse + * @constructor + * @param {google.cloud.asset.v1.ISearchAllResourcesResponse=} [properties] Properties to set + */ + function SearchAllResourcesResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAllResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @instance + */ + SearchAllResourcesResponse.prototype.results = $util.emptyArray; + + /** + * SearchAllResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @instance + */ + SearchAllResourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAllResourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {google.cloud.asset.v1.ISearchAllResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SearchAllResourcesResponse} SearchAllResourcesResponse instance + */ + SearchAllResourcesResponse.create = function create(properties) { + return new SearchAllResourcesResponse(properties); + }; + + /** + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {google.cloud.asset.v1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1.ResourceSearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {google.cloud.asset.v1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.SearchAllResourcesResponse} SearchAllResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllResourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SearchAllResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1.ResourceSearchResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.SearchAllResourcesResponse} SearchAllResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllResourcesResponse message. + * @function verify + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1.ResourceSearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.SearchAllResourcesResponse} SearchAllResourcesResponse + */ + SearchAllResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SearchAllResourcesResponse) + return object; + var message = new $root.google.cloud.asset.v1.SearchAllResourcesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1.SearchAllResourcesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1.SearchAllResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1.ResourceSearchResult.fromObject(object.results[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {google.cloud.asset.v1.SearchAllResourcesResponse} message SearchAllResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1.ResourceSearchResult.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAllResourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAllResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SearchAllResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SearchAllResourcesResponse"; + }; + + return SearchAllResourcesResponse; + })(); + + v1.SearchAllIamPoliciesRequest = (function() { + + /** + * Properties of a SearchAllIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @interface ISearchAllIamPoliciesRequest + * @property {string|null} [scope] SearchAllIamPoliciesRequest scope + * @property {string|null} [query] SearchAllIamPoliciesRequest query + * @property {number|null} [pageSize] SearchAllIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchAllIamPoliciesRequest pageToken + * @property {Array.|null} [assetTypes] SearchAllIamPoliciesRequest assetTypes + * @property {string|null} [orderBy] SearchAllIamPoliciesRequest orderBy + */ + + /** + * Constructs a new SearchAllIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a SearchAllIamPoliciesRequest. + * @implements ISearchAllIamPoliciesRequest + * @constructor + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + */ + function SearchAllIamPoliciesRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * SearchAllIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.scope = ""; + + /** + * SearchAllIamPoliciesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.query = ""; + + /** + * SearchAllIamPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.pageSize = 0; + + /** + * SearchAllIamPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.pageToken = ""; + + /** + * SearchAllIamPoliciesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.assetTypes = $util.emptyArray; + + /** + * SearchAllIamPoliciesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.orderBy = ""; + + /** + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest instance + */ + SearchAllIamPoliciesRequest.create = function create(properties) { + return new SearchAllIamPoliciesRequest(properties); + }; + + /** + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllIamPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.assetTypes[i]); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllIamPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SearchAllIamPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 7: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllIamPoliciesRequest message. + * @function verify + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllIamPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + */ + SearchAllIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SearchAllIamPoliciesRequest) + return object; + var message = new $root.google.cloud.asset.v1.SearchAllIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1.SearchAllIamPoliciesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.SearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllIamPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this SearchAllIamPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAllIamPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllIamPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllIamPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SearchAllIamPoliciesRequest"; + }; + + return SearchAllIamPoliciesRequest; + })(); + + v1.SearchAllIamPoliciesResponse = (function() { + + /** + * Properties of a SearchAllIamPoliciesResponse. + * @memberof google.cloud.asset.v1 + * @interface ISearchAllIamPoliciesResponse + * @property {Array.|null} [results] SearchAllIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchAllIamPoliciesResponse nextPageToken + */ + + /** + * Constructs a new SearchAllIamPoliciesResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a SearchAllIamPoliciesResponse. + * @implements ISearchAllIamPoliciesResponse + * @constructor + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + */ + function SearchAllIamPoliciesResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAllIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @instance + */ + SearchAllIamPoliciesResponse.prototype.results = $util.emptyArray; + + /** + * SearchAllIamPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @instance + */ + SearchAllIamPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse instance + */ + SearchAllIamPoliciesResponse.create = function create(properties) { + return new SearchAllIamPoliciesResponse(properties); + }; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllIamPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllIamPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SearchAllIamPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1.IamPolicySearchResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllIamPoliciesResponse message. + * @function verify + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllIamPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + */ + SearchAllIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SearchAllIamPoliciesResponse) + return object; + var message = new $root.google.cloud.asset.v1.SearchAllIamPoliciesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1.SearchAllIamPoliciesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1.SearchAllIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1.IamPolicySearchResult.fromObject(object.results[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.SearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllIamPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1.IamPolicySearchResult.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAllIamPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAllIamPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllIamPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SearchAllIamPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllIamPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SearchAllIamPoliciesResponse"; + }; + + return SearchAllIamPoliciesResponse; + })(); + + v1.IamPolicyAnalysisQuery = (function() { + + /** + * Properties of an IamPolicyAnalysisQuery. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisQuery + * @property {string|null} [scope] IamPolicyAnalysisQuery scope + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null} [resourceSelector] IamPolicyAnalysisQuery resourceSelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null} [identitySelector] IamPolicyAnalysisQuery identitySelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null} [accessSelector] IamPolicyAnalysisQuery accessSelector + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null} [options] IamPolicyAnalysisQuery options + * @property {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext|null} [conditionContext] IamPolicyAnalysisQuery conditionContext + */ + + /** + * Constructs a new IamPolicyAnalysisQuery. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisQuery. + * @implements IIamPolicyAnalysisQuery + * @constructor + * @param {google.cloud.asset.v1.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 scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.scope = ""; + + /** + * IamPolicyAnalysisQuery resourceSelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector|null|undefined} resourceSelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.resourceSelector = null; + + /** + * IamPolicyAnalysisQuery identitySelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector|null|undefined} identitySelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.identitySelector = null; + + /** + * IamPolicyAnalysisQuery accessSelector. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector|null|undefined} accessSelector + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.accessSelector = null; + + /** + * IamPolicyAnalysisQuery options. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions|null|undefined} options + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.options = null; + + /** + * IamPolicyAnalysisQuery conditionContext. + * @member {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext|null|undefined} conditionContext + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @instance + */ + IamPolicyAnalysisQuery.prototype.conditionContext = null; + + /** + * Creates a new IamPolicyAnalysisQuery instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisQuery=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery instance + */ + IamPolicyAnalysisQuery.create = function create(properties) { + return new IamPolicyAnalysisQuery(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisQuery message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1.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.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.resourceSelector != null && Object.hasOwnProperty.call(message, "resourceSelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.encode(message.resourceSelector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identitySelector != null && Object.hasOwnProperty.call(message, "identitySelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.encode(message.identitySelector, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.accessSelector != null && Object.hasOwnProperty.call(message, "accessSelector")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.encode(message.accessSelector, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.encode(message.options, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.conditionContext != null && Object.hasOwnProperty.call(message, "conditionContext")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.encode(message.conditionContext, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisQuery(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.decode(reader, reader.uint32()); + break; + } + case 3: { + message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.decode(reader, reader.uint32()); + break; + } + case 4: { + message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.decode(reader, reader.uint32()); + break; + } + case 5: { + message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.decode(reader, reader.uint32()); + break; + } + case 6: { + message.conditionContext = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.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.v1.IamPolicyAnalysisQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.verify(message.resourceSelector); + if (error) + return "resourceSelector." + error; + } + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.verify(message.identitySelector); + if (error) + return "identitySelector." + error; + } + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.verify(message.accessSelector); + if (error) + return "accessSelector." + error; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify(message.options); + if (error) + return "options." + error; + } + if (message.conditionContext != null && message.hasOwnProperty("conditionContext")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify(message.conditionContext); + if (error) + return "conditionContext." + 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.v1.IamPolicyAnalysisQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery} IamPolicyAnalysisQuery + */ + IamPolicyAnalysisQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.resourceSelector != null) { + if (typeof object.resourceSelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.resourceSelector: object expected"); + message.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.fromObject(object.resourceSelector); + } + if (object.identitySelector != null) { + if (typeof object.identitySelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.identitySelector: object expected"); + message.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.fromObject(object.identitySelector); + } + if (object.accessSelector != null) { + if (typeof object.accessSelector !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.accessSelector: object expected"); + message.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.fromObject(object.accessSelector); + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.options: object expected"); + message.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.fromObject(object.options); + } + if (object.conditionContext != null) { + if (typeof object.conditionContext !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.conditionContext: object expected"); + message.conditionContext = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.fromObject(object.conditionContext); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @static + * @param {google.cloud.asset.v1.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.scope = ""; + object.resourceSelector = null; + object.identitySelector = null; + object.accessSelector = null; + object.options = null; + object.conditionContext = null; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.resourceSelector != null && message.hasOwnProperty("resourceSelector")) + object.resourceSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector.toObject(message.resourceSelector, options); + if (message.identitySelector != null && message.hasOwnProperty("identitySelector")) + object.identitySelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector.toObject(message.identitySelector, options); + if (message.accessSelector != null && message.hasOwnProperty("accessSelector")) + object.accessSelector = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector.toObject(message.accessSelector, options); + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.toObject(message.options, options); + if (message.conditionContext != null && message.hasOwnProperty("conditionContext")) + object.conditionContext = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.toObject(message.conditionContext, options); + return object; + }; + + /** + * Converts this IamPolicyAnalysisQuery to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicyAnalysisQuery + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery"; + }; + + IamPolicyAnalysisQuery.ResourceSelector = (function() { + + /** + * Properties of a ResourceSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IResourceSelector + * @property {string|null} [fullResourceName] ResourceSelector fullResourceName + */ + + /** + * Constructs a new ResourceSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents a ResourceSelector. + * @implements IResourceSelector + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + */ + ResourceSelector.prototype.fullResourceName = ""; + + /** + * Creates a new ResourceSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IResourceSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "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.v1.IamPolicyAnalysisQuery.ResourceSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector} ResourceSelector + */ + ResourceSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector) + return object; + var message = new $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.ResourceSelector + * @instance + * @returns {Object.} JSON object + */ + ResourceSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceSelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.ResourceSelector"; + }; + + return ResourceSelector; + })(); + + IamPolicyAnalysisQuery.IdentitySelector = (function() { + + /** + * Properties of an IdentitySelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IIdentitySelector + * @property {string|null} [identity] IdentitySelector identity + */ + + /** + * Constructs a new IdentitySelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents an IdentitySelector. + * @implements IIdentitySelector + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + */ + IdentitySelector.prototype.identity = ""; + + /** + * Creates a new IdentitySelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IIdentitySelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "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.v1.IamPolicyAnalysisQuery.IdentitySelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector} IdentitySelector + */ + IdentitySelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector) + return object; + var message = new $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.IdentitySelector + * @instance + * @returns {Object.} JSON object + */ + IdentitySelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentitySelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentitySelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.IdentitySelector"; + }; + + return IdentitySelector; + })(); + + IamPolicyAnalysisQuery.AccessSelector = (function() { + + /** + * Properties of an AccessSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IAccessSelector + * @property {Array.|null} [roles] AccessSelector roles + * @property {Array.|null} [permissions] AccessSelector permissions + */ + + /** + * Constructs a new AccessSelector. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents an AccessSelector. + * @implements IAccessSelector + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.roles = $util.emptyArray; + + /** + * AccessSelector permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + */ + AccessSelector.prototype.permissions = $util.emptyArray; + + /** + * Creates a new AccessSelector instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IAccessSelector=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.AccessSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector} AccessSelector + */ + AccessSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector(); + if (object.roles) { + if (!Array.isArray(object.roles)) + throw TypeError(".google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisQuery.AccessSelector + * @instance + * @returns {Object.} JSON object + */ + AccessSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessSelector + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.AccessSelector"; + }; + + return AccessSelector; + })(); + + IamPolicyAnalysisQuery.Options = (function() { + + /** + * Properties of an Options. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @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.v1.IamPolicyAnalysisQuery + * @classdesc Represents an Options. + * @implements IOptions + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandGroups = false; + + /** + * Options expandRoles. + * @member {boolean} expandRoles + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandRoles = false; + + /** + * Options expandResources. + * @member {boolean} expandResources + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.expandResources = false; + + /** + * Options outputResourceEdges. + * @member {boolean} outputResourceEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.outputResourceEdges = false; + + /** + * Options outputGroupEdges. + * @member {boolean} outputGroupEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.outputGroupEdges = false; + + /** + * Options analyzeServiceAccountImpersonation. + * @member {boolean} analyzeServiceAccountImpersonation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @instance + */ + Options.prototype.analyzeServiceAccountImpersonation = false; + + /** + * Creates a new Options instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IOptions=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options instance + */ + Options.create = function create(properties) { + return new Options(properties); + }; + + /** + * Encodes the specified Options message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.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 && Object.hasOwnProperty.call(message, "expandGroups")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.expandGroups); + if (message.expandRoles != null && Object.hasOwnProperty.call(message, "expandRoles")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.expandRoles); + if (message.expandResources != null && Object.hasOwnProperty.call(message, "expandResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.expandResources); + if (message.outputResourceEdges != null && Object.hasOwnProperty.call(message, "outputResourceEdges")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.outputResourceEdges); + if (message.outputGroupEdges != null && Object.hasOwnProperty.call(message, "outputGroupEdges")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.outputGroupEdges); + if (message.analyzeServiceAccountImpersonation != null && Object.hasOwnProperty.call(message, "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.v1.IamPolicyAnalysisQuery.Options.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.Options} Options + */ + Options.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.Options) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.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.v1.IamPolicyAnalysisQuery.Options + * @instance + * @returns {Object.} JSON object + */ + Options.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Options + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.Options + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Options.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.Options"; + }; + + return Options; + })(); + + IamPolicyAnalysisQuery.ConditionContext = (function() { + + /** + * Properties of a ConditionContext. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @interface IConditionContext + * @property {google.protobuf.ITimestamp|null} [accessTime] ConditionContext accessTime + */ + + /** + * Constructs a new ConditionContext. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery + * @classdesc Represents a ConditionContext. + * @implements IConditionContext + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext=} [properties] Properties to set + */ + function ConditionContext(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]]; + } + + /** + * ConditionContext accessTime. + * @member {google.protobuf.ITimestamp|null|undefined} accessTime + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @instance + */ + ConditionContext.prototype.accessTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConditionContext TimeContext. + * @member {"accessTime"|undefined} TimeContext + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @instance + */ + Object.defineProperty(ConditionContext.prototype, "TimeContext", { + get: $util.oneOfGetter($oneOfFields = ["accessTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConditionContext instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} ConditionContext instance + */ + ConditionContext.create = function create(properties) { + return new ConditionContext(properties); + }; + + /** + * Encodes the specified ConditionContext message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext} message ConditionContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessTime != null && Object.hasOwnProperty.call(message, "accessTime")) + $root.google.protobuf.Timestamp.encode(message.accessTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ConditionContext message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.IConditionContext} message ConditionContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} ConditionContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionContext.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} ConditionContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionContext message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessTime != null && message.hasOwnProperty("accessTime")) { + properties.TimeContext = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.accessTime); + if (error) + return "accessTime." + error; + } + } + return null; + }; + + /** + * Creates a ConditionContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} ConditionContext + */ + ConditionContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext(); + if (object.accessTime != null) { + if (typeof object.accessTime !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext.accessTime: object expected"); + message.accessTime = $root.google.protobuf.Timestamp.fromObject(object.accessTime); + } + return message; + }; + + /** + * Creates a plain object from a ConditionContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext} message ConditionContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.accessTime != null && message.hasOwnProperty("accessTime")) { + object.accessTime = $root.google.protobuf.Timestamp.toObject(message.accessTime, options); + if (options.oneofs) + object.TimeContext = "accessTime"; + } + return object; + }; + + /** + * Converts this ConditionContext to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @instance + * @returns {Object.} JSON object + */ + ConditionContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionContext + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionContext.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisQuery.ConditionContext"; + }; + + return ConditionContext; + })(); + + return IamPolicyAnalysisQuery; + })(); + + v1.AnalyzeIamPolicyRequest = (function() { + + /** + * Properties of an AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyRequest + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyRequest analysisQuery + * @property {string|null} [savedAnalysisQuery] AnalyzeIamPolicyRequest savedAnalysisQuery + * @property {google.protobuf.IDuration|null} [executionTimeout] AnalyzeIamPolicyRequest executionTimeout + */ + + /** + * Constructs a new AnalyzeIamPolicyRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyRequest. + * @implements IAnalyzeIamPolicyRequest + * @constructor + * @param {google.cloud.asset.v1.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.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.analysisQuery = null; + + /** + * AnalyzeIamPolicyRequest savedAnalysisQuery. + * @member {string} savedAnalysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.savedAnalysisQuery = ""; + + /** + * AnalyzeIamPolicyRequest executionTimeout. + * @member {google.protobuf.IDuration|null|undefined} executionTimeout + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + */ + AnalyzeIamPolicyRequest.prototype.executionTimeout = null; + + /** + * Creates a new AnalyzeIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest instance + */ + AnalyzeIamPolicyRequest.create = function create(properties) { + return new AnalyzeIamPolicyRequest(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.executionTimeout != null && Object.hasOwnProperty.call(message, "executionTimeout")) + $root.google.protobuf.Duration.encode(message.executionTimeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedAnalysisQuery != null && Object.hasOwnProperty.call(message, "savedAnalysisQuery")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedAnalysisQuery); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.AnalyzeIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 3: { + message.savedAnalysisQuery = reader.string(); + break; + } + case 2: { + message.executionTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + 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.v1.AnalyzeIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + if (!$util.isString(message.savedAnalysisQuery)) + return "savedAnalysisQuery: string expected"; + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.executionTimeout); + if (error) + return "executionTimeout." + 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.v1.AnalyzeIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyRequest} AnalyzeIamPolicyRequest + */ + AnalyzeIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.savedAnalysisQuery != null) + message.savedAnalysisQuery = String(object.savedAnalysisQuery); + if (object.executionTimeout != null) { + if (typeof object.executionTimeout !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyRequest.executionTimeout: object expected"); + message.executionTimeout = $root.google.protobuf.Duration.fromObject(object.executionTimeout); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {google.cloud.asset.v1.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.executionTimeout = null; + object.savedAnalysisQuery = ""; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.executionTimeout != null && message.hasOwnProperty("executionTimeout")) + object.executionTimeout = $root.google.protobuf.Duration.toObject(message.executionTimeout, options); + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + object.savedAnalysisQuery = message.savedAnalysisQuery; + return object; + }; + + /** + * Converts this AnalyzeIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeIamPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyRequest"; + }; + + return AnalyzeIamPolicyRequest; + })(); + + v1.AnalyzeIamPolicyResponse = (function() { + + /** + * Properties of an AnalyzeIamPolicyResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyResponse + * @property {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null} [mainAnalysis] AnalyzeIamPolicyResponse mainAnalysis + * @property {Array.|null} [serviceAccountImpersonationAnalysis] AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis + * @property {boolean|null} [fullyExplored] AnalyzeIamPolicyResponse fullyExplored + */ + + /** + * Constructs a new AnalyzeIamPolicyResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyResponse. + * @implements IAnalyzeIamPolicyResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + */ + function AnalyzeIamPolicyResponse(properties) { + this.serviceAccountImpersonationAnalysis = []; + 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.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis|null|undefined} mainAnalysis + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.mainAnalysis = null; + + /** + * AnalyzeIamPolicyResponse serviceAccountImpersonationAnalysis. + * @member {Array.} serviceAccountImpersonationAnalysis + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.serviceAccountImpersonationAnalysis = $util.emptyArray; + + /** + * AnalyzeIamPolicyResponse fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @instance + */ + AnalyzeIamPolicyResponse.prototype.fullyExplored = false; + + /** + * Creates a new AnalyzeIamPolicyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse instance + */ + AnalyzeIamPolicyResponse.create = function create(properties) { + return new AnalyzeIamPolicyResponse(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "mainAnalysis")) + $root.google.cloud.asset.v1.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.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.encode(message.serviceAccountImpersonationAnalysis[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "fullyExplored")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.fullyExplored); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.AnalyzeIamPolicyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.serviceAccountImpersonationAnalysis && message.serviceAccountImpersonationAnalysis.length)) + message.serviceAccountImpersonationAnalysis = []; + message.serviceAccountImpersonationAnalysis.push($root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.decode(reader, reader.uint32())); + break; + } + case 3: { + message.fullyExplored = reader.bool(); + 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.v1.AnalyzeIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.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.v1.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"; + return null; + }; + + /** + * Creates an AnalyzeIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse} AnalyzeIamPolicyResponse + */ + AnalyzeIamPolicyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse(); + if (object.mainAnalysis != null) { + if (typeof object.mainAnalysis !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.mainAnalysis: object expected"); + message.mainAnalysis = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.mainAnalysis); + } + if (object.serviceAccountImpersonationAnalysis) { + if (!Array.isArray(object.serviceAccountImpersonationAnalysis)) + throw TypeError(".google.cloud.asset.v1.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.v1.AnalyzeIamPolicyResponse.serviceAccountImpersonationAnalysis: object expected"); + message.serviceAccountImpersonationAnalysis[i] = $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.fromObject(object.serviceAccountImpersonationAnalysis[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @static + * @param {google.cloud.asset.v1.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 = []; + if (options.defaults) { + object.mainAnalysis = null; + object.fullyExplored = false; + } + if (message.mainAnalysis != null && message.hasOwnProperty("mainAnalysis")) + object.mainAnalysis = $root.google.cloud.asset.v1.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.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.toObject(message.serviceAccountImpersonationAnalysis[j], options); + } + if (message.fullyExplored != null && message.hasOwnProperty("fullyExplored")) + object.fullyExplored = message.fullyExplored; + return object; + }; + + /** + * Converts this AnalyzeIamPolicyResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeIamPolicyResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyResponse"; + }; + + AnalyzeIamPolicyResponse.IamPolicyAnalysis = (function() { + + /** + * Properties of an IamPolicyAnalysis. + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @interface IIamPolicyAnalysis + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] IamPolicyAnalysis analysisQuery + * @property {Array.|null} [analysisResults] IamPolicyAnalysis analysisResults + * @property {boolean|null} [fullyExplored] IamPolicyAnalysis fullyExplored + * @property {Array.|null} [nonCriticalErrors] IamPolicyAnalysis nonCriticalErrors + */ + + /** + * Constructs a new IamPolicyAnalysis. + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse + * @classdesc Represents an IamPolicyAnalysis. + * @implements IIamPolicyAnalysis + * @constructor + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + */ + function IamPolicyAnalysis(properties) { + this.analysisResults = []; + 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]]; + } + + /** + * IamPolicyAnalysis analysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisQuery = null; + + /** + * IamPolicyAnalysis analysisResults. + * @member {Array.} analysisResults + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.analysisResults = $util.emptyArray; + + /** + * IamPolicyAnalysis fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.fullyExplored = false; + + /** + * IamPolicyAnalysis nonCriticalErrors. + * @member {Array.} nonCriticalErrors + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + */ + IamPolicyAnalysis.prototype.nonCriticalErrors = $util.emptyArray; + + /** + * Creates a new IamPolicyAnalysis instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IIamPolicyAnalysis=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.encode(message.analysisResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "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.v1.IamPolicyAnalysisState.encode(message.nonCriticalErrors[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.analysisResults && message.analysisResults.length)) + message.analysisResults = []; + message.analysisResults.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.decode(reader, reader.uint32())); + break; + } + case 3: { + message.fullyExplored = reader.bool(); + break; + } + case 5: { + if (!(message.nonCriticalErrors && message.nonCriticalErrors.length)) + message.nonCriticalErrors = []; + message.nonCriticalErrors.push($root.google.cloud.asset.v1.IamPolicyAnalysisState.decode(reader, reader.uint32())); + 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.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.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.v1.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"; + 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.v1.IamPolicyAnalysisState.verify(message.nonCriticalErrors[i]); + if (error) + return "nonCriticalErrors." + error; + } + } + return null; + }; + + /** + * Creates an IamPolicyAnalysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis} IamPolicyAnalysis + */ + IamPolicyAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.analysisResults) { + if (!Array.isArray(object.analysisResults)) + throw TypeError(".google.cloud.asset.v1.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.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.analysisResults: object expected"); + message.analysisResults[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.fromObject(object.analysisResults[i]); + } + } + if (object.fullyExplored != null) + message.fullyExplored = Boolean(object.fullyExplored); + if (object.nonCriticalErrors) { + if (!Array.isArray(object.nonCriticalErrors)) + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.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.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis.nonCriticalErrors: object expected"); + message.nonCriticalErrors[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisState.fromObject(object.nonCriticalErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {google.cloud.asset.v1.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 = []; + object.nonCriticalErrors = []; + } + if (options.defaults) { + object.analysisQuery = null; + object.fullyExplored = false; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.toObject(message.analysisResults[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.v1.IamPolicyAnalysisState.toObject(message.nonCriticalErrors[j], options); + } + return object; + }; + + /** + * Converts this IamPolicyAnalysis to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicyAnalysis + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyResponse.IamPolicyAnalysis"; + }; + + return IamPolicyAnalysis; + })(); + + return AnalyzeIamPolicyResponse; + })(); + + v1.IamPolicyAnalysisOutputConfig = (function() { + + /** + * Properties of an IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisOutputConfig + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null} [gcsDestination] IamPolicyAnalysisOutputConfig gcsDestination + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null} [bigqueryDestination] IamPolicyAnalysisOutputConfig bigqueryDestination + */ + + /** + * Constructs a new IamPolicyAnalysisOutputConfig. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisOutputConfig. + * @implements IIamPolicyAnalysisOutputConfig + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisOutputConfig.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @instance + */ + IamPolicyAnalysisOutputConfig.prototype.gcsDestination = null; + + /** + * IamPolicyAnalysisOutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @instance + */ + IamPolicyAnalysisOutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IamPolicyAnalysisOutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @instance + */ + Object.defineProperty(IamPolicyAnalysisOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IamPolicyAnalysisOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig instance + */ + IamPolicyAnalysisOutputConfig.create = function create(properties) { + return new IamPolicyAnalysisOutputConfig(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.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.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + 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.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} IamPolicyAnalysisOutputConfig + */ + IamPolicyAnalysisOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicyAnalysisOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this IamPolicyAnalysisOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicyAnalysisOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisOutputConfig"; + }; + + IamPolicyAnalysisOutputConfig.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = ""; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "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.v1.IamPolicyAnalysisOutputConfig.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.GcsDestination"; + }; + + return GcsDestination; + })(); + + IamPolicyAnalysisOutputConfig.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [tablePrefix] BigQueryDestination tablePrefix + * @property {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey|null} [partitionKey] BigQueryDestination partitionKey + * @property {string|null} [writeDisposition] BigQueryDestination writeDisposition + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * BigQueryDestination tablePrefix. + * @member {string} tablePrefix + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.tablePrefix = ""; + + /** + * BigQueryDestination partitionKey. + * @member {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey} partitionKey + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.partitionKey = 0; + + /** + * BigQueryDestination writeDisposition. + * @member {string} writeDisposition + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.writeDisposition = ""; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.tablePrefix != null && Object.hasOwnProperty.call(message, "tablePrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tablePrefix); + if (message.partitionKey != null && Object.hasOwnProperty.call(message, "partitionKey")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.partitionKey); + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.writeDisposition); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.tablePrefix = reader.string(); + break; + } + case 3: { + message.partitionKey = reader.int32(); + break; + } + case 4: { + message.writeDisposition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) + if (!$util.isString(message.tablePrefix)) + return "tablePrefix: string expected"; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + switch (message.partitionKey) { + default: + return "partitionKey: enum value expected"; + case 0: + case 1: + break; + } + if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) + if (!$util.isString(message.writeDisposition)) + return "writeDisposition: string expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.tablePrefix != null) + message.tablePrefix = String(object.tablePrefix); + switch (object.partitionKey) { + default: + if (typeof object.partitionKey === "number") { + message.partitionKey = object.partitionKey; + break; + } + break; + case "PARTITION_KEY_UNSPECIFIED": + case 0: + message.partitionKey = 0; + break; + case "REQUEST_TIME": + case 1: + message.partitionKey = 1; + break; + } + if (object.writeDisposition != null) + message.writeDisposition = String(object.writeDisposition); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.tablePrefix = ""; + object.partitionKey = options.enums === String ? "PARTITION_KEY_UNSPECIFIED" : 0; + object.writeDisposition = ""; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.tablePrefix != null && message.hasOwnProperty("tablePrefix")) + object.tablePrefix = message.tablePrefix; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey[message.partitionKey] === undefined ? message.partitionKey : $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey[message.partitionKey] : message.partitionKey; + if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) + object.writeDisposition = message.writeDisposition; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination"; + }; + + /** + * PartitionKey enum. + * @name google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.BigQueryDestination.PartitionKey + * @enum {number} + * @property {number} PARTITION_KEY_UNSPECIFIED=0 PARTITION_KEY_UNSPECIFIED value + * @property {number} REQUEST_TIME=1 REQUEST_TIME value + */ + BigQueryDestination.PartitionKey = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_KEY_UNSPECIFIED"] = 0; + values[valuesById[1] = "REQUEST_TIME"] = 1; + return values; + })(); + + return BigQueryDestination; + })(); + + return IamPolicyAnalysisOutputConfig; + })(); + + v1.AnalyzeIamPolicyLongrunningRequest = (function() { + + /** + * Properties of an AnalyzeIamPolicyLongrunningRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyLongrunningRequest + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [analysisQuery] AnalyzeIamPolicyLongrunningRequest analysisQuery + * @property {string|null} [savedAnalysisQuery] AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery + * @property {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null} [outputConfig] AnalyzeIamPolicyLongrunningRequest outputConfig + */ + + /** + * Constructs a new AnalyzeIamPolicyLongrunningRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyLongrunningRequest. + * @implements IAnalyzeIamPolicyLongrunningRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest=} [properties] Properties to set + */ + function AnalyzeIamPolicyLongrunningRequest(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]]; + } + + /** + * AnalyzeIamPolicyLongrunningRequest analysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} analysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + */ + AnalyzeIamPolicyLongrunningRequest.prototype.analysisQuery = null; + + /** + * AnalyzeIamPolicyLongrunningRequest savedAnalysisQuery. + * @member {string} savedAnalysisQuery + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + */ + AnalyzeIamPolicyLongrunningRequest.prototype.savedAnalysisQuery = ""; + + /** + * AnalyzeIamPolicyLongrunningRequest outputConfig. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + */ + AnalyzeIamPolicyLongrunningRequest.prototype.outputConfig = null; + + /** + * Creates a new AnalyzeIamPolicyLongrunningRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} AnalyzeIamPolicyLongrunningRequest instance + */ + AnalyzeIamPolicyLongrunningRequest.create = function create(properties) { + return new AnalyzeIamPolicyLongrunningRequest(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest} message AnalyzeIamPolicyLongrunningRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analysisQuery != null && Object.hasOwnProperty.call(message, "analysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.analysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedAnalysisQuery != null && Object.hasOwnProperty.call(message, "savedAnalysisQuery")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedAnalysisQuery); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest} message AnalyzeIamPolicyLongrunningRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} AnalyzeIamPolicyLongrunningRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + case 3: { + message.savedAnalysisQuery = reader.string(); + break; + } + case 2: { + message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} AnalyzeIamPolicyLongrunningRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyLongrunningRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyLongrunningRequest.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.v1.IamPolicyAnalysisQuery.verify(message.analysisQuery); + if (error) + return "analysisQuery." + error; + } + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + if (!$util.isString(message.savedAnalysisQuery)) + return "savedAnalysisQuery: string expected"; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an AnalyzeIamPolicyLongrunningRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} AnalyzeIamPolicyLongrunningRequest + */ + AnalyzeIamPolicyLongrunningRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest(); + if (object.analysisQuery != null) { + if (typeof object.analysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.analysisQuery: object expected"); + message.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.analysisQuery); + } + if (object.savedAnalysisQuery != null) + message.savedAnalysisQuery = String(object.savedAnalysisQuery); + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest} message AnalyzeIamPolicyLongrunningRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyLongrunningRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.analysisQuery = null; + object.outputConfig = null; + object.savedAnalysisQuery = ""; + } + if (message.analysisQuery != null && message.hasOwnProperty("analysisQuery")) + object.analysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.analysisQuery, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.IamPolicyAnalysisOutputConfig.toObject(message.outputConfig, options); + if (message.savedAnalysisQuery != null && message.hasOwnProperty("savedAnalysisQuery")) + object.savedAnalysisQuery = message.savedAnalysisQuery; + return object; + }; + + /** + * Converts this AnalyzeIamPolicyLongrunningRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyLongrunningRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyLongrunningRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest"; + }; + + return AnalyzeIamPolicyLongrunningRequest; + })(); + + v1.AnalyzeIamPolicyLongrunningResponse = (function() { + + /** + * Properties of an AnalyzeIamPolicyLongrunningResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeIamPolicyLongrunningResponse + */ + + /** + * Constructs a new AnalyzeIamPolicyLongrunningResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeIamPolicyLongrunningResponse. + * @implements IAnalyzeIamPolicyLongrunningResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse=} [properties] Properties to set + */ + function AnalyzeIamPolicyLongrunningResponse(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]]; + } + + /** + * Creates a new AnalyzeIamPolicyLongrunningResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} AnalyzeIamPolicyLongrunningResponse instance + */ + AnalyzeIamPolicyLongrunningResponse.create = function create(properties) { + return new AnalyzeIamPolicyLongrunningResponse(properties); + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse} message AnalyzeIamPolicyLongrunningResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AnalyzeIamPolicyLongrunningResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse} message AnalyzeIamPolicyLongrunningResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeIamPolicyLongrunningResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} AnalyzeIamPolicyLongrunningResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeIamPolicyLongrunningResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} AnalyzeIamPolicyLongrunningResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeIamPolicyLongrunningResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeIamPolicyLongrunningResponse message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeIamPolicyLongrunningResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AnalyzeIamPolicyLongrunningResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} AnalyzeIamPolicyLongrunningResponse + */ + AnalyzeIamPolicyLongrunningResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse) + return object; + return new $root.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse(); + }; + + /** + * Creates a plain object from an AnalyzeIamPolicyLongrunningResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse} message AnalyzeIamPolicyLongrunningResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeIamPolicyLongrunningResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AnalyzeIamPolicyLongrunningResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeIamPolicyLongrunningResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeIamPolicyLongrunningResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeIamPolicyLongrunningResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse"; + }; + + return AnalyzeIamPolicyLongrunningResponse; + })(); + + v1.SavedQuery = (function() { + + /** + * Properties of a SavedQuery. + * @memberof google.cloud.asset.v1 + * @interface ISavedQuery + * @property {string|null} [name] SavedQuery name + * @property {string|null} [description] SavedQuery description + * @property {google.protobuf.ITimestamp|null} [createTime] SavedQuery createTime + * @property {string|null} [creator] SavedQuery creator + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] SavedQuery lastUpdateTime + * @property {string|null} [lastUpdater] SavedQuery lastUpdater + * @property {Object.|null} [labels] SavedQuery labels + * @property {google.cloud.asset.v1.SavedQuery.IQueryContent|null} [content] SavedQuery content + */ + + /** + * Constructs a new SavedQuery. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a SavedQuery. + * @implements ISavedQuery + * @constructor + * @param {google.cloud.asset.v1.ISavedQuery=} [properties] Properties to set + */ + function SavedQuery(properties) { + this.labels = {}; + 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]]; + } + + /** + * SavedQuery name. + * @member {string} name + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.name = ""; + + /** + * SavedQuery description. + * @member {string} description + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.description = ""; + + /** + * SavedQuery createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.createTime = null; + + /** + * SavedQuery creator. + * @member {string} creator + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.creator = ""; + + /** + * SavedQuery lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.lastUpdateTime = null; + + /** + * SavedQuery lastUpdater. + * @member {string} lastUpdater + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.lastUpdater = ""; + + /** + * SavedQuery labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.labels = $util.emptyObject; + + /** + * SavedQuery content. + * @member {google.cloud.asset.v1.SavedQuery.IQueryContent|null|undefined} content + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + */ + SavedQuery.prototype.content = null; + + /** + * Creates a new SavedQuery instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {google.cloud.asset.v1.ISavedQuery=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery instance + */ + SavedQuery.create = function create(properties) { + return new SavedQuery(properties); + }; + + /** + * Encodes the specified SavedQuery message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {google.cloud.asset.v1.ISavedQuery} message SavedQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SavedQuery.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.creator); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.lastUpdater != null && Object.hasOwnProperty.call(message, "lastUpdater")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.lastUpdater); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.asset.v1.SavedQuery.QueryContent.encode(message.content, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SavedQuery message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {google.cloud.asset.v1.ISavedQuery} message SavedQuery message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SavedQuery.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SavedQuery message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SavedQuery.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SavedQuery(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.creator = reader.string(); + break; + } + case 5: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.lastUpdater = reader.string(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + message.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SavedQuery message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SavedQuery.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SavedQuery message. + * @function verify + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SavedQuery.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.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.lastUpdater != null && message.hasOwnProperty("lastUpdater")) + if (!$util.isString(message.lastUpdater)) + return "lastUpdater: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.cloud.asset.v1.SavedQuery.QueryContent.verify(message.content); + if (error) + return "content." + error; + } + return null; + }; + + /** + * Creates a SavedQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.SavedQuery} SavedQuery + */ + SavedQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SavedQuery) + return object; + var message = new $root.google.cloud.asset.v1.SavedQuery(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.lastUpdater != null) + message.lastUpdater = String(object.lastUpdater); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.content: object expected"); + message.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.fromObject(object.content); + } + return message; + }; + + /** + * Creates a plain object from a SavedQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {google.cloud.asset.v1.SavedQuery} message SavedQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SavedQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.creator = ""; + object.lastUpdateTime = null; + object.lastUpdater = ""; + object.content = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.lastUpdater != null && message.hasOwnProperty("lastUpdater")) + object.lastUpdater = message.lastUpdater; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.cloud.asset.v1.SavedQuery.QueryContent.toObject(message.content, options); + return object; + }; + + /** + * Converts this SavedQuery to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.SavedQuery + * @instance + * @returns {Object.} JSON object + */ + SavedQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SavedQuery + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SavedQuery + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SavedQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SavedQuery"; + }; + + SavedQuery.QueryContent = (function() { + + /** + * Properties of a QueryContent. + * @memberof google.cloud.asset.v1.SavedQuery + * @interface IQueryContent + * @property {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null} [iamPolicyAnalysisQuery] QueryContent iamPolicyAnalysisQuery + */ + + /** + * Constructs a new QueryContent. + * @memberof google.cloud.asset.v1.SavedQuery + * @classdesc Represents a QueryContent. + * @implements IQueryContent + * @constructor + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent=} [properties] Properties to set + */ + function QueryContent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryContent iamPolicyAnalysisQuery. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisQuery|null|undefined} iamPolicyAnalysisQuery + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + */ + QueryContent.prototype.iamPolicyAnalysisQuery = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryContent queryContent. + * @member {"iamPolicyAnalysisQuery"|undefined} queryContent + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + */ + Object.defineProperty(QueryContent.prototype, "queryContent", { + get: $util.oneOfGetter($oneOfFields = ["iamPolicyAnalysisQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryContent instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent=} [properties] Properties to set + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent instance + */ + QueryContent.create = function create(properties) { + return new QueryContent(properties); + }; + + /** + * Encodes the specified QueryContent message. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent} message QueryContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.iamPolicyAnalysisQuery != null && Object.hasOwnProperty.call(message, "iamPolicyAnalysisQuery")) + $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.encode(message.iamPolicyAnalysisQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryContent message, length delimited. Does not implicitly {@link google.cloud.asset.v1.SavedQuery.QueryContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.IQueryContent} message QueryContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryContent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.SavedQuery.QueryContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryContent message. + * @function verify + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.iamPolicyAnalysisQuery != null && message.hasOwnProperty("iamPolicyAnalysisQuery")) { + properties.queryContent = 1; + { + var error = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.verify(message.iamPolicyAnalysisQuery); + if (error) + return "iamPolicyAnalysisQuery." + error; + } + } + return null; + }; + + /** + * Creates a QueryContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.SavedQuery.QueryContent} QueryContent + */ + QueryContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.SavedQuery.QueryContent) + return object; + var message = new $root.google.cloud.asset.v1.SavedQuery.QueryContent(); + if (object.iamPolicyAnalysisQuery != null) { + if (typeof object.iamPolicyAnalysisQuery !== "object") + throw TypeError(".google.cloud.asset.v1.SavedQuery.QueryContent.iamPolicyAnalysisQuery: object expected"); + message.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.fromObject(object.iamPolicyAnalysisQuery); + } + return message; + }; + + /** + * Creates a plain object from a QueryContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {google.cloud.asset.v1.SavedQuery.QueryContent} message QueryContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.iamPolicyAnalysisQuery != null && message.hasOwnProperty("iamPolicyAnalysisQuery")) { + object.iamPolicyAnalysisQuery = $root.google.cloud.asset.v1.IamPolicyAnalysisQuery.toObject(message.iamPolicyAnalysisQuery, options); + if (options.oneofs) + object.queryContent = "iamPolicyAnalysisQuery"; + } + return object; + }; + + /** + * Converts this QueryContent to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @instance + * @returns {Object.} JSON object + */ + QueryContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryContent + * @function getTypeUrl + * @memberof google.cloud.asset.v1.SavedQuery.QueryContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.SavedQuery.QueryContent"; + }; + + return QueryContent; + })(); + + return SavedQuery; + })(); + + v1.CreateSavedQueryRequest = (function() { + + /** + * Properties of a CreateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface ICreateSavedQueryRequest + * @property {string|null} [parent] CreateSavedQueryRequest parent + * @property {google.cloud.asset.v1.ISavedQuery|null} [savedQuery] CreateSavedQueryRequest savedQuery + * @property {string|null} [savedQueryId] CreateSavedQueryRequest savedQueryId + */ + + /** + * Constructs a new CreateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a CreateSavedQueryRequest. + * @implements ICreateSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest=} [properties] Properties to set + */ + function CreateSavedQueryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSavedQueryRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.parent = ""; + + /** + * CreateSavedQueryRequest savedQuery. + * @member {google.cloud.asset.v1.ISavedQuery|null|undefined} savedQuery + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.savedQuery = null; + + /** + * CreateSavedQueryRequest savedQueryId. + * @member {string} savedQueryId + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + */ + CreateSavedQueryRequest.prototype.savedQueryId = ""; + + /** + * Creates a new CreateSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest instance + */ + CreateSavedQueryRequest.create = function create(properties) { + return new CreateSavedQueryRequest(properties); + }; + + /** + * Encodes the specified CreateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} message CreateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.savedQuery != null && Object.hasOwnProperty.call(message, "savedQuery")) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQuery, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.savedQueryId != null && Object.hasOwnProperty.call(message, "savedQueryId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.savedQueryId); + return writer; + }; + + /** + * Encodes the specified CreateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.CreateSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.ICreateSavedQueryRequest} message CreateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSavedQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.CreateSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); + break; + } + case 3: { + message.savedQueryId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQuery); + if (error) + return "savedQuery." + error; + } + if (message.savedQueryId != null && message.hasOwnProperty("savedQueryId")) + if (!$util.isString(message.savedQueryId)) + return "savedQueryId: string expected"; + return null; + }; + + /** + * Creates a CreateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.CreateSavedQueryRequest} CreateSavedQueryRequest + */ + CreateSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.CreateSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.CreateSavedQueryRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.savedQuery != null) { + if (typeof object.savedQuery !== "object") + throw TypeError(".google.cloud.asset.v1.CreateSavedQueryRequest.savedQuery: object expected"); + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQuery); + } + if (object.savedQueryId != null) + message.savedQueryId = String(object.savedQueryId); + return message; + }; + + /** + * Creates a plain object from a CreateSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.CreateSavedQueryRequest} message CreateSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.savedQuery = null; + object.savedQueryId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) + object.savedQuery = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQuery, options); + if (message.savedQueryId != null && message.hasOwnProperty("savedQueryId")) + object.savedQueryId = message.savedQueryId; + return object; + }; + + /** + * Converts this CreateSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSavedQueryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.CreateSavedQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSavedQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.CreateSavedQueryRequest"; + }; + + return CreateSavedQueryRequest; + })(); + + v1.GetSavedQueryRequest = (function() { + + /** + * Properties of a GetSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IGetSavedQueryRequest + * @property {string|null} [name] GetSavedQueryRequest name + */ + + /** + * Constructs a new GetSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a GetSavedQueryRequest. + * @implements IGetSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IGetSavedQueryRequest=} [properties] Properties to set + */ + function GetSavedQueryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSavedQueryRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @instance + */ + GetSavedQueryRequest.prototype.name = ""; + + /** + * Creates a new GetSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest instance + */ + GetSavedQueryRequest.create = function create(properties) { + return new GetSavedQueryRequest(properties); + }; + + /** + * Encodes the specified GetSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} message GetSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.GetSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IGetSavedQueryRequest} message GetSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSavedQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.GetSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.GetSavedQueryRequest} GetSavedQueryRequest + */ + GetSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.GetSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.GetSavedQueryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.GetSavedQueryRequest} message GetSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + GetSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSavedQueryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.GetSavedQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSavedQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.GetSavedQueryRequest"; + }; + + return GetSavedQueryRequest; + })(); + + v1.ListSavedQueriesRequest = (function() { + + /** + * Properties of a ListSavedQueriesRequest. + * @memberof google.cloud.asset.v1 + * @interface IListSavedQueriesRequest + * @property {string|null} [parent] ListSavedQueriesRequest parent + * @property {string|null} [filter] ListSavedQueriesRequest filter + * @property {number|null} [pageSize] ListSavedQueriesRequest pageSize + * @property {string|null} [pageToken] ListSavedQueriesRequest pageToken + */ + + /** + * Constructs a new ListSavedQueriesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListSavedQueriesRequest. + * @implements IListSavedQueriesRequest + * @constructor + * @param {google.cloud.asset.v1.IListSavedQueriesRequest=} [properties] Properties to set + */ + function ListSavedQueriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSavedQueriesRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.parent = ""; + + /** + * ListSavedQueriesRequest filter. + * @member {string} filter + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.filter = ""; + + /** + * ListSavedQueriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.pageSize = 0; + + /** + * ListSavedQueriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + */ + ListSavedQueriesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSavedQueriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest instance + */ + ListSavedQueriesRequest.create = function create(properties) { + return new ListSavedQueriesRequest(properties); + }; + + /** + * Encodes the specified ListSavedQueriesRequest message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} message ListSavedQueriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSavedQueriesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesRequest} message ListSavedQueriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListSavedQueriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSavedQueriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSavedQueriesRequest message. + * @function verify + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSavedQueriesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListSavedQueriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListSavedQueriesRequest} ListSavedQueriesRequest + */ + ListSavedQueriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListSavedQueriesRequest) + return object; + var message = new $root.google.cloud.asset.v1.ListSavedQueriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListSavedQueriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {google.cloud.asset.v1.ListSavedQueriesRequest} message ListSavedQueriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSavedQueriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSavedQueriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSavedQueriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSavedQueriesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListSavedQueriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSavedQueriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListSavedQueriesRequest"; + }; + + return ListSavedQueriesRequest; + })(); + + v1.ListSavedQueriesResponse = (function() { + + /** + * Properties of a ListSavedQueriesResponse. + * @memberof google.cloud.asset.v1 + * @interface IListSavedQueriesResponse + * @property {Array.|null} [savedQueries] ListSavedQueriesResponse savedQueries + * @property {string|null} [nextPageToken] ListSavedQueriesResponse nextPageToken + */ + + /** + * Constructs a new ListSavedQueriesResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ListSavedQueriesResponse. + * @implements IListSavedQueriesResponse + * @constructor + * @param {google.cloud.asset.v1.IListSavedQueriesResponse=} [properties] Properties to set + */ + function ListSavedQueriesResponse(properties) { + this.savedQueries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSavedQueriesResponse savedQueries. + * @member {Array.} savedQueries + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + */ + ListSavedQueriesResponse.prototype.savedQueries = $util.emptyArray; + + /** + * ListSavedQueriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + */ + ListSavedQueriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSavedQueriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse instance + */ + ListSavedQueriesResponse.create = function create(properties) { + return new ListSavedQueriesResponse(properties); + }; + + /** + * Encodes the specified ListSavedQueriesResponse message. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse} message ListSavedQueriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.savedQueries != null && message.savedQueries.length) + for (var i = 0; i < message.savedQueries.length; ++i) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQueries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSavedQueriesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ListSavedQueriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.IListSavedQueriesResponse} message ListSavedQueriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSavedQueriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ListSavedQueriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.savedQueries && message.savedQueries.length)) + message.savedQueries = []; + message.savedQueries.push($root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSavedQueriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSavedQueriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSavedQueriesResponse message. + * @function verify + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSavedQueriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.savedQueries != null && message.hasOwnProperty("savedQueries")) { + if (!Array.isArray(message.savedQueries)) + return "savedQueries: array expected"; + for (var i = 0; i < message.savedQueries.length; ++i) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQueries[i]); + if (error) + return "savedQueries." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSavedQueriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ListSavedQueriesResponse} ListSavedQueriesResponse + */ + ListSavedQueriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ListSavedQueriesResponse) + return object; + var message = new $root.google.cloud.asset.v1.ListSavedQueriesResponse(); + if (object.savedQueries) { + if (!Array.isArray(object.savedQueries)) + throw TypeError(".google.cloud.asset.v1.ListSavedQueriesResponse.savedQueries: array expected"); + message.savedQueries = []; + for (var i = 0; i < object.savedQueries.length; ++i) { + if (typeof object.savedQueries[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ListSavedQueriesResponse.savedQueries: object expected"); + message.savedQueries[i] = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQueries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSavedQueriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {google.cloud.asset.v1.ListSavedQueriesResponse} message ListSavedQueriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSavedQueriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.savedQueries = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.savedQueries && message.savedQueries.length) { + object.savedQueries = []; + for (var j = 0; j < message.savedQueries.length; ++j) + object.savedQueries[j] = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQueries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSavedQueriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSavedQueriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSavedQueriesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ListSavedQueriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSavedQueriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ListSavedQueriesResponse"; + }; + + return ListSavedQueriesResponse; + })(); + + v1.UpdateSavedQueryRequest = (function() { + + /** + * Properties of an UpdateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IUpdateSavedQueryRequest + * @property {google.cloud.asset.v1.ISavedQuery|null} [savedQuery] UpdateSavedQueryRequest savedQuery + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSavedQueryRequest updateMask + */ + + /** + * Constructs a new UpdateSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an UpdateSavedQueryRequest. + * @implements IUpdateSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest=} [properties] Properties to set + */ + function UpdateSavedQueryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSavedQueryRequest savedQuery. + * @member {google.cloud.asset.v1.ISavedQuery|null|undefined} savedQuery + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + */ + UpdateSavedQueryRequest.prototype.savedQuery = null; + + /** + * UpdateSavedQueryRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + */ + UpdateSavedQueryRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest instance + */ + UpdateSavedQueryRequest.create = function create(properties) { + return new UpdateSavedQueryRequest(properties); + }; + + /** + * Encodes the specified UpdateSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} message UpdateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.savedQuery != null && Object.hasOwnProperty.call(message, "savedQuery")) + $root.google.cloud.asset.v1.SavedQuery.encode(message.savedQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.UpdateSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IUpdateSavedQueryRequest} message UpdateSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSavedQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.UpdateSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) { + var error = $root.google.cloud.asset.v1.SavedQuery.verify(message.savedQuery); + if (error) + return "savedQuery." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.UpdateSavedQueryRequest} UpdateSavedQueryRequest + */ + UpdateSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.UpdateSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.UpdateSavedQueryRequest(); + if (object.savedQuery != null) { + if (typeof object.savedQuery !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateSavedQueryRequest.savedQuery: object expected"); + message.savedQuery = $root.google.cloud.asset.v1.SavedQuery.fromObject(object.savedQuery); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1.UpdateSavedQueryRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.UpdateSavedQueryRequest} message UpdateSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.savedQuery = null; + object.updateMask = null; + } + if (message.savedQuery != null && message.hasOwnProperty("savedQuery")) + object.savedQuery = $root.google.cloud.asset.v1.SavedQuery.toObject(message.savedQuery, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSavedQueryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.UpdateSavedQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSavedQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.UpdateSavedQueryRequest"; + }; + + return UpdateSavedQueryRequest; + })(); + + v1.DeleteSavedQueryRequest = (function() { + + /** + * Properties of a DeleteSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @interface IDeleteSavedQueryRequest + * @property {string|null} [name] DeleteSavedQueryRequest name + */ + + /** + * Constructs a new DeleteSavedQueryRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a DeleteSavedQueryRequest. + * @implements IDeleteSavedQueryRequest + * @constructor + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest=} [properties] Properties to set + */ + function DeleteSavedQueryRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSavedQueryRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @instance + */ + DeleteSavedQueryRequest.prototype.name = ""; + + /** + * Creates a new DeleteSavedQueryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest instance + */ + DeleteSavedQueryRequest.create = function create(properties) { + return new DeleteSavedQueryRequest(properties); + }; + + /** + * Encodes the specified DeleteSavedQueryRequest message. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} message DeleteSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSavedQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSavedQueryRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.DeleteSavedQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.IDeleteSavedQueryRequest} message DeleteSavedQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSavedQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSavedQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.DeleteSavedQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSavedQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSavedQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSavedQueryRequest message. + * @function verify + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSavedQueryRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSavedQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.DeleteSavedQueryRequest} DeleteSavedQueryRequest + */ + DeleteSavedQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.DeleteSavedQueryRequest) + return object; + var message = new $root.google.cloud.asset.v1.DeleteSavedQueryRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSavedQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {google.cloud.asset.v1.DeleteSavedQueryRequest} message DeleteSavedQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSavedQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteSavedQueryRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSavedQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSavedQueryRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.DeleteSavedQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSavedQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.DeleteSavedQueryRequest"; + }; + + return DeleteSavedQueryRequest; + })(); + + v1.AnalyzeMoveRequest = (function() { + + /** + * Properties of an AnalyzeMoveRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeMoveRequest + * @property {string|null} [resource] AnalyzeMoveRequest resource + * @property {string|null} [destinationParent] AnalyzeMoveRequest destinationParent + * @property {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView|null} [view] AnalyzeMoveRequest view + */ + + /** + * Constructs a new AnalyzeMoveRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeMoveRequest. + * @implements IAnalyzeMoveRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + */ + function AnalyzeMoveRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeMoveRequest resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.resource = ""; + + /** + * AnalyzeMoveRequest destinationParent. + * @member {string} destinationParent + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.destinationParent = ""; + + /** + * AnalyzeMoveRequest view. + * @member {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} view + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + */ + AnalyzeMoveRequest.prototype.view = 0; + + /** + * Creates a new AnalyzeMoveRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest instance + */ + AnalyzeMoveRequest.create = function create(properties) { + return new AnalyzeMoveRequest(properties); + }; + + /** + * Encodes the specified AnalyzeMoveRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.destinationParent != null && Object.hasOwnProperty.call(message, "destinationParent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destinationParent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.view); + return writer; + }; + + /** + * Encodes the specified AnalyzeMoveRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveRequest} message AnalyzeMoveRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeMoveRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 2: { + message.destinationParent = reader.string(); + break; + } + case 3: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeMoveRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeMoveRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeMoveRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + if (!$util.isString(message.destinationParent)) + return "destinationParent: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an AnalyzeMoveRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeMoveRequest} AnalyzeMoveRequest + */ + AnalyzeMoveRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeMoveRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeMoveRequest(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.destinationParent != null) + message.destinationParent = String(object.destinationParent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "ANALYSIS_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "FULL": + case 1: + message.view = 1; + break; + case "BASIC": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeMoveRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeMoveRequest} message AnalyzeMoveRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeMoveRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.destinationParent = ""; + object.view = options.enums === String ? "ANALYSIS_VIEW_UNSPECIFIED" : 0; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.destinationParent != null && message.hasOwnProperty("destinationParent")) + object.destinationParent = message.destinationParent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] === undefined ? message.view : $root.google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView[message.view] : message.view; + return object; + }; + + /** + * Converts this AnalyzeMoveRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeMoveRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeMoveRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeMoveRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeMoveRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeMoveRequest"; + }; + + /** + * AnalysisView enum. + * @name google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView + * @enum {number} + * @property {number} ANALYSIS_VIEW_UNSPECIFIED=0 ANALYSIS_VIEW_UNSPECIFIED value + * @property {number} FULL=1 FULL value + * @property {number} BASIC=2 BASIC value + */ + AnalyzeMoveRequest.AnalysisView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANALYSIS_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL"] = 1; + values[valuesById[2] = "BASIC"] = 2; + return values; + })(); + + return AnalyzeMoveRequest; + })(); + + v1.AnalyzeMoveResponse = (function() { + + /** + * Properties of an AnalyzeMoveResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeMoveResponse + * @property {Array.|null} [moveAnalysis] AnalyzeMoveResponse moveAnalysis + */ + + /** + * Constructs a new AnalyzeMoveResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeMoveResponse. + * @implements IAnalyzeMoveResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set + */ + function AnalyzeMoveResponse(properties) { + this.moveAnalysis = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeMoveResponse moveAnalysis. + * @member {Array.} moveAnalysis + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @instance + */ + AnalyzeMoveResponse.prototype.moveAnalysis = $util.emptyArray; + + /** + * Creates a new AnalyzeMoveResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse instance + */ + AnalyzeMoveResponse.create = function create(properties) { + return new AnalyzeMoveResponse(properties); + }; + + /** + * Encodes the specified AnalyzeMoveResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.moveAnalysis != null && message.moveAnalysis.length) + for (var i = 0; i < message.moveAnalysis.length; ++i) + $root.google.cloud.asset.v1.MoveAnalysis.encode(message.moveAnalysis[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeMoveResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeMoveResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeMoveResponse} message AnalyzeMoveResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeMoveResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeMoveResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.moveAnalysis && message.moveAnalysis.length)) + message.moveAnalysis = []; + message.moveAnalysis.push($root.google.cloud.asset.v1.MoveAnalysis.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeMoveResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeMoveResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeMoveResponse message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeMoveResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.moveAnalysis != null && message.hasOwnProperty("moveAnalysis")) { + if (!Array.isArray(message.moveAnalysis)) + return "moveAnalysis: array expected"; + for (var i = 0; i < message.moveAnalysis.length; ++i) { + var error = $root.google.cloud.asset.v1.MoveAnalysis.verify(message.moveAnalysis[i]); + if (error) + return "moveAnalysis." + error; + } + } + return null; + }; + + /** + * Creates an AnalyzeMoveResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeMoveResponse} AnalyzeMoveResponse + */ + AnalyzeMoveResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeMoveResponse) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeMoveResponse(); + if (object.moveAnalysis) { + if (!Array.isArray(object.moveAnalysis)) + throw TypeError(".google.cloud.asset.v1.AnalyzeMoveResponse.moveAnalysis: array expected"); + message.moveAnalysis = []; + for (var i = 0; i < object.moveAnalysis.length; ++i) { + if (typeof object.moveAnalysis[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeMoveResponse.moveAnalysis: object expected"); + message.moveAnalysis[i] = $root.google.cloud.asset.v1.MoveAnalysis.fromObject(object.moveAnalysis[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeMoveResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {google.cloud.asset.v1.AnalyzeMoveResponse} message AnalyzeMoveResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeMoveResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.moveAnalysis = []; + if (message.moveAnalysis && message.moveAnalysis.length) { + object.moveAnalysis = []; + for (var j = 0; j < message.moveAnalysis.length; ++j) + object.moveAnalysis[j] = $root.google.cloud.asset.v1.MoveAnalysis.toObject(message.moveAnalysis[j], options); + } + return object; + }; + + /** + * Converts this AnalyzeMoveResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeMoveResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeMoveResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeMoveResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeMoveResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeMoveResponse"; + }; + + return AnalyzeMoveResponse; + })(); + + v1.MoveAnalysis = (function() { + + /** + * Properties of a MoveAnalysis. + * @memberof google.cloud.asset.v1 + * @interface IMoveAnalysis + * @property {string|null} [displayName] MoveAnalysis displayName + * @property {google.cloud.asset.v1.IMoveAnalysisResult|null} [analysis] MoveAnalysis analysis + * @property {google.rpc.IStatus|null} [error] MoveAnalysis error + */ + + /** + * Constructs a new MoveAnalysis. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a MoveAnalysis. + * @implements IMoveAnalysis + * @constructor + * @param {google.cloud.asset.v1.IMoveAnalysis=} [properties] Properties to set + */ + function MoveAnalysis(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]]; + } + + /** + * MoveAnalysis displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + */ + MoveAnalysis.prototype.displayName = ""; + + /** + * MoveAnalysis analysis. + * @member {google.cloud.asset.v1.IMoveAnalysisResult|null|undefined} analysis + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + */ + MoveAnalysis.prototype.analysis = null; + + /** + * MoveAnalysis error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + */ + MoveAnalysis.prototype.error = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MoveAnalysis result. + * @member {"analysis"|"error"|undefined} result + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + */ + Object.defineProperty(MoveAnalysis.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["analysis", "error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MoveAnalysis instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {google.cloud.asset.v1.IMoveAnalysis=} [properties] Properties to set + * @returns {google.cloud.asset.v1.MoveAnalysis} MoveAnalysis instance + */ + MoveAnalysis.create = function create(properties) { + return new MoveAnalysis(properties); + }; + + /** + * Encodes the specified MoveAnalysis message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {google.cloud.asset.v1.IMoveAnalysis} message MoveAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAnalysis.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.analysis != null && Object.hasOwnProperty.call(message, "analysis")) + $root.google.cloud.asset.v1.MoveAnalysisResult.encode(message.analysis, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MoveAnalysis message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysis.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {google.cloud.asset.v1.IMoveAnalysis} message MoveAnalysis message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAnalysis.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveAnalysis message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.MoveAnalysis} MoveAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysis.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.MoveAnalysis(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.analysis = $root.google.cloud.asset.v1.MoveAnalysisResult.decode(reader, reader.uint32()); + break; + } + case 3: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveAnalysis message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveAnalysis} MoveAnalysis + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysis.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveAnalysis message. + * @function verify + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveAnalysis.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.analysis != null && message.hasOwnProperty("analysis")) { + properties.result = 1; + { + var error = $root.google.cloud.asset.v1.MoveAnalysisResult.verify(message.analysis); + if (error) + return "analysis." + error; + } + } + if (message.error != null && message.hasOwnProperty("error")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + return null; + }; + + /** + * Creates a MoveAnalysis message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveAnalysis} MoveAnalysis + */ + MoveAnalysis.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveAnalysis) + return object; + var message = new $root.google.cloud.asset.v1.MoveAnalysis(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.analysis != null) { + if (typeof object.analysis !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysis.analysis: object expected"); + message.analysis = $root.google.cloud.asset.v1.MoveAnalysisResult.fromObject(object.analysis); + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysis.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a MoveAnalysis message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {google.cloud.asset.v1.MoveAnalysis} message MoveAnalysis + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveAnalysis.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.displayName = ""; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.analysis != null && message.hasOwnProperty("analysis")) { + object.analysis = $root.google.cloud.asset.v1.MoveAnalysisResult.toObject(message.analysis, options); + if (options.oneofs) + object.result = "analysis"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + return object; + }; + + /** + * Converts this MoveAnalysis to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveAnalysis + * @instance + * @returns {Object.} JSON object + */ + MoveAnalysis.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveAnalysis + * @function getTypeUrl + * @memberof google.cloud.asset.v1.MoveAnalysis + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveAnalysis.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.MoveAnalysis"; + }; + + return MoveAnalysis; + })(); + + v1.MoveAnalysisResult = (function() { + + /** + * Properties of a MoveAnalysisResult. + * @memberof google.cloud.asset.v1 + * @interface IMoveAnalysisResult + * @property {Array.|null} [blockers] MoveAnalysisResult blockers + * @property {Array.|null} [warnings] MoveAnalysisResult warnings + */ + + /** + * Constructs a new MoveAnalysisResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a MoveAnalysisResult. + * @implements IMoveAnalysisResult + * @constructor + * @param {google.cloud.asset.v1.IMoveAnalysisResult=} [properties] Properties to set + */ + function MoveAnalysisResult(properties) { + this.blockers = []; + this.warnings = []; + 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]]; + } + + /** + * MoveAnalysisResult blockers. + * @member {Array.} blockers + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @instance + */ + MoveAnalysisResult.prototype.blockers = $util.emptyArray; + + /** + * MoveAnalysisResult warnings. + * @member {Array.} warnings + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @instance + */ + MoveAnalysisResult.prototype.warnings = $util.emptyArray; + + /** + * Creates a new MoveAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.IMoveAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult instance + */ + MoveAnalysisResult.create = function create(properties) { + return new MoveAnalysisResult(properties); + }; + + /** + * Encodes the specified MoveAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.IMoveAnalysisResult} message MoveAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockers != null && message.blockers.length) + for (var i = 0; i < message.blockers.length; ++i) + $root.google.cloud.asset.v1.MoveImpact.encode(message.blockers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + $root.google.cloud.asset.v1.MoveImpact.encode(message.warnings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MoveAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.IMoveAnalysisResult} message MoveAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysisResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.MoveAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.blockers && message.blockers.length)) + message.blockers = []; + message.blockers.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.cloud.asset.v1.MoveImpact.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveAnalysisResult message. + * @function verify + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveAnalysisResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockers != null && message.hasOwnProperty("blockers")) { + if (!Array.isArray(message.blockers)) + return "blockers: array expected"; + for (var i = 0; i < message.blockers.length; ++i) { + var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.blockers[i]); + if (error) + return "blockers." + error; + } + } + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) { + var error = $root.google.cloud.asset.v1.MoveImpact.verify(message.warnings[i]); + if (error) + return "warnings." + error; + } + } + return null; + }; + + /** + * Creates a MoveAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveAnalysisResult} MoveAnalysisResult + */ + MoveAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1.MoveAnalysisResult(); + if (object.blockers) { + if (!Array.isArray(object.blockers)) + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: array expected"); + message.blockers = []; + for (var i = 0; i < object.blockers.length; ++i) { + if (typeof object.blockers[i] !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.blockers: object expected"); + message.blockers[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.blockers[i]); + } + } + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.asset.v1.MoveAnalysisResult.warnings: object expected"); + message.warnings[i] = $root.google.cloud.asset.v1.MoveImpact.fromObject(object.warnings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MoveAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {google.cloud.asset.v1.MoveAnalysisResult} message MoveAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.blockers = []; + object.warnings = []; + } + if (message.blockers && message.blockers.length) { + object.blockers = []; + for (var j = 0; j < message.blockers.length; ++j) + object.blockers[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.blockers[j], options); + } + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.cloud.asset.v1.MoveImpact.toObject(message.warnings[j], options); + } + return object; + }; + + /** + * Converts this MoveAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + MoveAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.MoveAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.MoveAnalysisResult"; + }; + + return MoveAnalysisResult; + })(); + + v1.MoveImpact = (function() { + + /** + * Properties of a MoveImpact. + * @memberof google.cloud.asset.v1 + * @interface IMoveImpact + * @property {string|null} [detail] MoveImpact detail + */ + + /** + * Constructs a new MoveImpact. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a MoveImpact. + * @implements IMoveImpact + * @constructor + * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + */ + function MoveImpact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MoveImpact detail. + * @member {string} detail + * @memberof google.cloud.asset.v1.MoveImpact + * @instance + */ + MoveImpact.prototype.detail = ""; + + /** + * Creates a new MoveImpact instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact=} [properties] Properties to set + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact instance + */ + MoveImpact.create = function create(properties) { + return new MoveImpact(properties); + }; + + /** + * Encodes the specified MoveImpact message. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveImpact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detail != null && Object.hasOwnProperty.call(message, "detail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.detail); + return writer; + }; + + /** + * Encodes the specified MoveImpact message, length delimited. Does not implicitly {@link google.cloud.asset.v1.MoveImpact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.IMoveImpact} message MoveImpact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MoveImpact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MoveImpact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveImpact.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.MoveImpact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.detail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MoveImpact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MoveImpact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MoveImpact message. + * @function verify + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MoveImpact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.detail != null && message.hasOwnProperty("detail")) + if (!$util.isString(message.detail)) + return "detail: string expected"; + return null; + }; + + /** + * Creates a MoveImpact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.MoveImpact} MoveImpact + */ + MoveImpact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.MoveImpact) + return object; + var message = new $root.google.cloud.asset.v1.MoveImpact(); + if (object.detail != null) + message.detail = String(object.detail); + return message; + }; + + /** + * Creates a plain object from a MoveImpact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {google.cloud.asset.v1.MoveImpact} message MoveImpact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MoveImpact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.detail = ""; + if (message.detail != null && message.hasOwnProperty("detail")) + object.detail = message.detail; + return object; + }; + + /** + * Converts this MoveImpact to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.MoveImpact + * @instance + * @returns {Object.} JSON object + */ + MoveImpact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MoveImpact + * @function getTypeUrl + * @memberof google.cloud.asset.v1.MoveImpact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MoveImpact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.MoveImpact"; + }; + + return MoveImpact; + })(); + + v1.QueryAssetsOutputConfig = (function() { + + /** + * Properties of a QueryAssetsOutputConfig. + * @memberof google.cloud.asset.v1 + * @interface IQueryAssetsOutputConfig + * @property {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination|null} [bigqueryDestination] QueryAssetsOutputConfig bigqueryDestination + */ + + /** + * Constructs a new QueryAssetsOutputConfig. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a QueryAssetsOutputConfig. + * @implements IQueryAssetsOutputConfig + * @constructor + * @param {google.cloud.asset.v1.IQueryAssetsOutputConfig=} [properties] Properties to set + */ + function QueryAssetsOutputConfig(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]]; + } + + /** + * QueryAssetsOutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @instance + */ + QueryAssetsOutputConfig.prototype.bigqueryDestination = null; + + /** + * Creates a new QueryAssetsOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {google.cloud.asset.v1.IQueryAssetsOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig} QueryAssetsOutputConfig instance + */ + QueryAssetsOutputConfig.create = function create(properties) { + return new QueryAssetsOutputConfig(properties); + }; + + /** + * Encodes the specified QueryAssetsOutputConfig message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {google.cloud.asset.v1.IQueryAssetsOutputConfig} message QueryAssetsOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAssetsOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {google.cloud.asset.v1.IQueryAssetsOutputConfig} message QueryAssetsOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAssetsOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig} QueryAssetsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.QueryAssetsOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.bigqueryDestination = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAssetsOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig} QueryAssetsOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAssetsOutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAssetsOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + var error = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + return null; + }; + + /** + * Creates a QueryAssetsOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig} QueryAssetsOutputConfig + */ + QueryAssetsOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryAssetsOutputConfig) + return object; + var message = new $root.google.cloud.asset.v1.QueryAssetsOutputConfig(); + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsOutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from a QueryAssetsOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig} message QueryAssetsOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAssetsOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.bigqueryDestination = null; + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) + object.bigqueryDestination = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.toObject(message.bigqueryDestination, options); + return object; + }; + + /** + * Converts this QueryAssetsOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @instance + * @returns {Object.} JSON object + */ + QueryAssetsOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryAssetsOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAssetsOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryAssetsOutputConfig"; + }; + + QueryAssetsOutputConfig.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [table] BigQueryDestination table + * @property {string|null} [writeDisposition] BigQueryDestination writeDisposition + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * BigQueryDestination table. + * @member {string} table + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.table = ""; + + /** + * BigQueryDestination writeDisposition. + * @member {string} writeDisposition + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.writeDisposition = ""; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.writeDisposition != null && Object.hasOwnProperty.call(message, "writeDisposition")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.writeDisposition); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.table = reader.string(); + break; + } + case 3: { + message.writeDisposition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) + if (!$util.isString(message.writeDisposition)) + return "writeDisposition: string expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination) + return object; + var message = new $root.google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.table != null) + message.table = String(object.table); + if (object.writeDisposition != null) + message.writeDisposition = String(object.writeDisposition); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.table = ""; + object.writeDisposition = ""; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.writeDisposition != null && message.hasOwnProperty("writeDisposition")) + object.writeDisposition = message.writeDisposition; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryAssetsOutputConfig.BigQueryDestination"; + }; + + return BigQueryDestination; + })(); + + return QueryAssetsOutputConfig; + })(); + + v1.QueryAssetsRequest = (function() { + + /** + * Properties of a QueryAssetsRequest. + * @memberof google.cloud.asset.v1 + * @interface IQueryAssetsRequest + * @property {string|null} [parent] QueryAssetsRequest parent + * @property {string|null} [statement] QueryAssetsRequest statement + * @property {string|null} [jobReference] QueryAssetsRequest jobReference + * @property {number|null} [pageSize] QueryAssetsRequest pageSize + * @property {string|null} [pageToken] QueryAssetsRequest pageToken + * @property {google.protobuf.IDuration|null} [timeout] QueryAssetsRequest timeout + * @property {google.cloud.asset.v1.ITimeWindow|null} [readTimeWindow] QueryAssetsRequest readTimeWindow + * @property {google.protobuf.ITimestamp|null} [readTime] QueryAssetsRequest readTime + * @property {google.cloud.asset.v1.IQueryAssetsOutputConfig|null} [outputConfig] QueryAssetsRequest outputConfig + */ + + /** + * Constructs a new QueryAssetsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a QueryAssetsRequest. + * @implements IQueryAssetsRequest + * @constructor + * @param {google.cloud.asset.v1.IQueryAssetsRequest=} [properties] Properties to set + */ + function QueryAssetsRequest(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]]; + } + + /** + * QueryAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.parent = ""; + + /** + * QueryAssetsRequest statement. + * @member {string|null|undefined} statement + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.statement = null; + + /** + * QueryAssetsRequest jobReference. + * @member {string|null|undefined} jobReference + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.jobReference = null; + + /** + * QueryAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.pageSize = 0; + + /** + * QueryAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.pageToken = ""; + + /** + * QueryAssetsRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.timeout = null; + + /** + * QueryAssetsRequest readTimeWindow. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} readTimeWindow + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.readTimeWindow = null; + + /** + * QueryAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.readTime = null; + + /** + * QueryAssetsRequest outputConfig. + * @member {google.cloud.asset.v1.IQueryAssetsOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + QueryAssetsRequest.prototype.outputConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryAssetsRequest query. + * @member {"statement"|"jobReference"|undefined} query + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + Object.defineProperty(QueryAssetsRequest.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["statement", "jobReference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * QueryAssetsRequest time. + * @member {"readTimeWindow"|"readTime"|undefined} time + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + */ + Object.defineProperty(QueryAssetsRequest.prototype, "time", { + get: $util.oneOfGetter($oneOfFields = ["readTimeWindow", "readTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {google.cloud.asset.v1.IQueryAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryAssetsRequest} QueryAssetsRequest instance + */ + QueryAssetsRequest.create = function create(properties) { + return new QueryAssetsRequest(properties); + }; + + /** + * Encodes the specified QueryAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {google.cloud.asset.v1.IQueryAssetsRequest} message QueryAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.statement != null && Object.hasOwnProperty.call(message, "statement")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.statement); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jobReference); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.readTimeWindow != null && Object.hasOwnProperty.call(message, "readTimeWindow")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.QueryAssetsOutputConfig.encode(message.outputConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {google.cloud.asset.v1.IQueryAssetsRequest} message QueryAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryAssetsRequest} QueryAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.QueryAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.statement = reader.string(); + break; + } + case 3: { + message.jobReference = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 6: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 7: { + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 8: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryAssetsRequest} QueryAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.statement != null && message.hasOwnProperty("statement")) { + properties.query = 1; + if (!$util.isString(message.statement)) + return "statement: string expected"; + } + if (message.jobReference != null && message.hasOwnProperty("jobReference")) { + if (properties.query === 1) + return "query: multiple values"; + properties.query = 1; + if (!$util.isString(message.jobReference)) + return "jobReference: string expected"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + properties.time = 1; + { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.readTimeWindow); + if (error) + return "readTimeWindow." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.time === 1) + return "time: multiple values"; + properties.time = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates a QueryAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryAssetsRequest} QueryAssetsRequest + */ + QueryAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1.QueryAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.statement != null) + message.statement = String(object.statement); + if (object.jobReference != null) + message.jobReference = String(object.jobReference); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + if (object.readTimeWindow != null) { + if (typeof object.readTimeWindow !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsRequest.readTimeWindow: object expected"); + message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.readTimeWindow); + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a QueryAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {google.cloud.asset.v1.QueryAssetsRequest} message QueryAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.timeout = null; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.statement != null && message.hasOwnProperty("statement")) { + object.statement = message.statement; + if (options.oneofs) + object.query = "statement"; + } + if (message.jobReference != null && message.hasOwnProperty("jobReference")) { + object.jobReference = message.jobReference; + if (options.oneofs) + object.query = "jobReference"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { + object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); + if (options.oneofs) + object.time = "readTimeWindow"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (options.oneofs) + object.time = "readTime"; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this QueryAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + QueryAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryAssetsRequest"; + }; + + return QueryAssetsRequest; + })(); + + v1.QueryAssetsResponse = (function() { + + /** + * Properties of a QueryAssetsResponse. + * @memberof google.cloud.asset.v1 + * @interface IQueryAssetsResponse + * @property {string|null} [jobReference] QueryAssetsResponse jobReference + * @property {boolean|null} [done] QueryAssetsResponse done + * @property {google.rpc.IStatus|null} [error] QueryAssetsResponse error + * @property {google.cloud.asset.v1.IQueryResult|null} [queryResult] QueryAssetsResponse queryResult + * @property {google.cloud.asset.v1.IQueryAssetsOutputConfig|null} [outputConfig] QueryAssetsResponse outputConfig + */ + + /** + * Constructs a new QueryAssetsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a QueryAssetsResponse. + * @implements IQueryAssetsResponse + * @constructor + * @param {google.cloud.asset.v1.IQueryAssetsResponse=} [properties] Properties to set + */ + function QueryAssetsResponse(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]]; + } + + /** + * QueryAssetsResponse jobReference. + * @member {string} jobReference + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.jobReference = ""; + + /** + * QueryAssetsResponse done. + * @member {boolean} done + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.done = false; + + /** + * QueryAssetsResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.error = null; + + /** + * QueryAssetsResponse queryResult. + * @member {google.cloud.asset.v1.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.queryResult = null; + + /** + * QueryAssetsResponse outputConfig. + * @member {google.cloud.asset.v1.IQueryAssetsOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + QueryAssetsResponse.prototype.outputConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryAssetsResponse response. + * @member {"error"|"queryResult"|"outputConfig"|undefined} response + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + */ + Object.defineProperty(QueryAssetsResponse.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["error", "queryResult", "outputConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {google.cloud.asset.v1.IQueryAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryAssetsResponse} QueryAssetsResponse instance + */ + QueryAssetsResponse.create = function create(properties) { + return new QueryAssetsResponse(properties); + }; + + /** + * Encodes the specified QueryAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {google.cloud.asset.v1.IQueryAssetsResponse} message QueryAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.jobReference != null && Object.hasOwnProperty.call(message, "jobReference")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.jobReference); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.asset.v1.QueryResult.encode(message.queryResult, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1.QueryAssetsOutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {google.cloud.asset.v1.IQueryAssetsResponse} message QueryAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryAssetsResponse} QueryAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.QueryAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.jobReference = reader.string(); + break; + } + case 2: { + message.done = reader.bool(); + break; + } + case 3: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.queryResult = $root.google.cloud.asset.v1.QueryResult.decode(reader, reader.uint32()); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryAssetsResponse} QueryAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.jobReference != null && message.hasOwnProperty("jobReference")) + if (!$util.isString(message.jobReference)) + return "jobReference: string expected"; + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.response = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.cloud.asset.v1.QueryResult.verify(message.queryResult); + if (error) + return "queryResult." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + if (properties.response === 1) + return "response: multiple values"; + properties.response = 1; + { + var error = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + } + return null; + }; + + /** + * Creates a QueryAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryAssetsResponse} QueryAssetsResponse + */ + QueryAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1.QueryAssetsResponse(); + if (object.jobReference != null) + message.jobReference = String(object.jobReference); + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.asset.v1.QueryResult.fromObject(object.queryResult); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1.QueryAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from a QueryAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {google.cloud.asset.v1.QueryAssetsResponse} message QueryAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.jobReference = ""; + object.done = false; + } + if (message.jobReference != null && message.hasOwnProperty("jobReference")) + object.jobReference = message.jobReference; + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.response = "error"; + } + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + object.queryResult = $root.google.cloud.asset.v1.QueryResult.toObject(message.queryResult, options); + if (options.oneofs) + object.response = "queryResult"; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + object.outputConfig = $root.google.cloud.asset.v1.QueryAssetsOutputConfig.toObject(message.outputConfig, options); + if (options.oneofs) + object.response = "outputConfig"; + } + return object; + }; + + /** + * Converts this QueryAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + QueryAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryAssetsResponse"; + }; + + return QueryAssetsResponse; + })(); + + v1.QueryResult = (function() { + + /** + * Properties of a QueryResult. + * @memberof google.cloud.asset.v1 + * @interface IQueryResult + * @property {Array.|null} [rows] QueryResult rows + * @property {google.cloud.asset.v1.ITableSchema|null} [schema] QueryResult schema + * @property {string|null} [nextPageToken] QueryResult nextPageToken + * @property {number|Long|null} [totalRows] QueryResult totalRows + */ + + /** + * Constructs a new QueryResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a QueryResult. + * @implements IQueryResult + * @constructor + * @param {google.cloud.asset.v1.IQueryResult=} [properties] Properties to set + */ + function QueryResult(properties) { + this.rows = []; + 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]]; + } + + /** + * QueryResult rows. + * @member {Array.} rows + * @memberof google.cloud.asset.v1.QueryResult + * @instance + */ + QueryResult.prototype.rows = $util.emptyArray; + + /** + * QueryResult schema. + * @member {google.cloud.asset.v1.ITableSchema|null|undefined} schema + * @memberof google.cloud.asset.v1.QueryResult + * @instance + */ + QueryResult.prototype.schema = null; + + /** + * QueryResult nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.QueryResult + * @instance + */ + QueryResult.prototype.nextPageToken = ""; + + /** + * QueryResult totalRows. + * @member {number|Long} totalRows + * @memberof google.cloud.asset.v1.QueryResult + * @instance + */ + QueryResult.prototype.totalRows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new QueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {google.cloud.asset.v1.IQueryResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.QueryResult} QueryResult instance + */ + QueryResult.create = function create(properties) { + return new QueryResult(properties); + }; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.asset.v1.QueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {google.cloud.asset.v1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.protobuf.Struct.encode(message.rows[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + $root.google.cloud.asset.v1.TableSchema.encode(message.schema, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + if (message.totalRows != null && Object.hasOwnProperty.call(message, "totalRows")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalRows); + return writer; + }; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.QueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {google.cloud.asset.v1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.QueryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); + break; + } + case 2: { + message.schema = $root.google.cloud.asset.v1.TableSchema.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + message.totalRows = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryResult message. + * @function verify + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.schema != null && message.hasOwnProperty("schema")) { + var error = $root.google.cloud.asset.v1.TableSchema.verify(message.schema); + if (error) + return "schema." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.totalRows != null && message.hasOwnProperty("totalRows")) + if (!$util.isInteger(message.totalRows) && !(message.totalRows && $util.isInteger(message.totalRows.low) && $util.isInteger(message.totalRows.high))) + return "totalRows: integer|Long expected"; + return null; + }; + + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.QueryResult} QueryResult + */ + QueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.QueryResult) + return object; + var message = new $root.google.cloud.asset.v1.QueryResult(); + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.asset.v1.QueryResult.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.cloud.asset.v1.QueryResult.rows: object expected"); + message.rows[i] = $root.google.protobuf.Struct.fromObject(object.rows[i]); + } + } + if (object.schema != null) { + if (typeof object.schema !== "object") + throw TypeError(".google.cloud.asset.v1.QueryResult.schema: object expected"); + message.schema = $root.google.cloud.asset.v1.TableSchema.fromObject(object.schema); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.totalRows != null) + if ($util.Long) + (message.totalRows = $util.Long.fromValue(object.totalRows)).unsigned = false; + else if (typeof object.totalRows === "string") + message.totalRows = parseInt(object.totalRows, 10); + else if (typeof object.totalRows === "number") + message.totalRows = object.totalRows; + else if (typeof object.totalRows === "object") + message.totalRows = new $util.LongBits(object.totalRows.low >>> 0, object.totalRows.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {google.cloud.asset.v1.QueryResult} message QueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) { + object.schema = null; + object.nextPageToken = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalRows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalRows = options.longs === String ? "0" : 0; + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.protobuf.Struct.toObject(message.rows[j], options); + } + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = $root.google.cloud.asset.v1.TableSchema.toObject(message.schema, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.totalRows != null && message.hasOwnProperty("totalRows")) + if (typeof message.totalRows === "number") + object.totalRows = options.longs === String ? String(message.totalRows) : message.totalRows; + else + object.totalRows = options.longs === String ? $util.Long.prototype.toString.call(message.totalRows) : options.longs === Number ? new $util.LongBits(message.totalRows.low >>> 0, message.totalRows.high >>> 0).toNumber() : message.totalRows; + return object; + }; + + /** + * Converts this QueryResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.QueryResult + * @instance + * @returns {Object.} JSON object + */ + QueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.QueryResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.QueryResult"; + }; + + return QueryResult; + })(); + + v1.TableSchema = (function() { + + /** + * Properties of a TableSchema. + * @memberof google.cloud.asset.v1 + * @interface ITableSchema + * @property {Array.|null} [fields] TableSchema fields + */ + + /** + * Constructs a new TableSchema. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TableSchema. + * @implements ITableSchema + * @constructor + * @param {google.cloud.asset.v1.ITableSchema=} [properties] Properties to set + */ + function TableSchema(properties) { + this.fields = []; + 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]]; + } + + /** + * TableSchema fields. + * @member {Array.} fields + * @memberof google.cloud.asset.v1.TableSchema + * @instance + */ + TableSchema.prototype.fields = $util.emptyArray; + + /** + * Creates a new TableSchema instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {google.cloud.asset.v1.ITableSchema=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TableSchema} TableSchema instance + */ + TableSchema.create = function create(properties) { + return new TableSchema(properties); + }; + + /** + * Encodes the specified TableSchema message. Does not implicitly {@link google.cloud.asset.v1.TableSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {google.cloud.asset.v1.ITableSchema} message TableSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.asset.v1.TableFieldSchema.encode(message.fields[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableSchema message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TableSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {google.cloud.asset.v1.ITableSchema} message TableSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TableSchema} TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSchema.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TableSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.asset.v1.TableFieldSchema.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TableSchema} TableSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableSchema message. + * @function verify + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.asset.v1.TableFieldSchema.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a TableSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TableSchema} TableSchema + */ + TableSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TableSchema) + return object; + var message = new $root.google.cloud.asset.v1.TableSchema(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.asset.v1.TableSchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.asset.v1.TableSchema.fields: object expected"); + message.fields[i] = $root.google.cloud.asset.v1.TableFieldSchema.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {google.cloud.asset.v1.TableSchema} message TableSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.asset.v1.TableFieldSchema.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this TableSchema to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TableSchema + * @instance + * @returns {Object.} JSON object + */ + TableSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableSchema + * @function getTypeUrl + * @memberof google.cloud.asset.v1.TableSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.TableSchema"; + }; + + return TableSchema; + })(); + + v1.TableFieldSchema = (function() { + + /** + * Properties of a TableFieldSchema. + * @memberof google.cloud.asset.v1 + * @interface ITableFieldSchema + * @property {string|null} [field] TableFieldSchema field + * @property {string|null} [type] TableFieldSchema type + * @property {string|null} [mode] TableFieldSchema mode + * @property {Array.|null} [fields] TableFieldSchema fields + */ + + /** + * Constructs a new TableFieldSchema. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TableFieldSchema. + * @implements ITableFieldSchema + * @constructor + * @param {google.cloud.asset.v1.ITableFieldSchema=} [properties] Properties to set + */ + function TableFieldSchema(properties) { + this.fields = []; + 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]]; + } + + /** + * TableFieldSchema field. + * @member {string} field + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.field = ""; + + /** + * TableFieldSchema type. + * @member {string} type + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.type = ""; + + /** + * TableFieldSchema mode. + * @member {string} mode + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.mode = ""; + + /** + * TableFieldSchema fields. + * @member {Array.} fields + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + */ + TableFieldSchema.prototype.fields = $util.emptyArray; + + /** + * Creates a new TableFieldSchema instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {google.cloud.asset.v1.ITableFieldSchema=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TableFieldSchema} TableFieldSchema instance + */ + TableFieldSchema.create = function create(properties) { + return new TableFieldSchema(properties); + }; + + /** + * Encodes the specified TableFieldSchema message. Does not implicitly {@link google.cloud.asset.v1.TableFieldSchema.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {google.cloud.asset.v1.ITableFieldSchema} message TableFieldSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableFieldSchema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.field != null && Object.hasOwnProperty.call(message, "field")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mode); + if (message.fields != null && message.fields.length) + for (var i = 0; i < message.fields.length; ++i) + $root.google.cloud.asset.v1.TableFieldSchema.encode(message.fields[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableFieldSchema message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TableFieldSchema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {google.cloud.asset.v1.ITableFieldSchema} message TableFieldSchema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableFieldSchema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TableFieldSchema} TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableFieldSchema.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TableFieldSchema(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.field = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.mode = reader.string(); + break; + } + case 4: { + if (!(message.fields && message.fields.length)) + message.fields = []; + message.fields.push($root.google.cloud.asset.v1.TableFieldSchema.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableFieldSchema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TableFieldSchema} TableFieldSchema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableFieldSchema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableFieldSchema message. + * @function verify + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableFieldSchema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.field != null && message.hasOwnProperty("field")) + if (!$util.isString(message.field)) + return "field: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + if (!$util.isString(message.mode)) + return "mode: string expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!Array.isArray(message.fields)) + return "fields: array expected"; + for (var i = 0; i < message.fields.length; ++i) { + var error = $root.google.cloud.asset.v1.TableFieldSchema.verify(message.fields[i]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a TableFieldSchema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TableFieldSchema} TableFieldSchema + */ + TableFieldSchema.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TableFieldSchema) + return object; + var message = new $root.google.cloud.asset.v1.TableFieldSchema(); + if (object.field != null) + message.field = String(object.field); + if (object.type != null) + message.type = String(object.type); + if (object.mode != null) + message.mode = String(object.mode); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.cloud.asset.v1.TableFieldSchema.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.cloud.asset.v1.TableFieldSchema.fields: object expected"); + message.fields[i] = $root.google.cloud.asset.v1.TableFieldSchema.fromObject(object.fields[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableFieldSchema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {google.cloud.asset.v1.TableFieldSchema} message TableFieldSchema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableFieldSchema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fields = []; + if (options.defaults) { + object.field = ""; + object.type = ""; + object.mode = ""; + } + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = message.mode; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.cloud.asset.v1.TableFieldSchema.toObject(message.fields[j], options); + } + return object; + }; + + /** + * Converts this TableFieldSchema to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TableFieldSchema + * @instance + * @returns {Object.} JSON object + */ + TableFieldSchema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TableFieldSchema + * @function getTypeUrl + * @memberof google.cloud.asset.v1.TableFieldSchema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TableFieldSchema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.TableFieldSchema"; + }; + + return TableFieldSchema; + })(); + + v1.BatchGetEffectiveIamPoliciesRequest = (function() { + + /** + * Properties of a BatchGetEffectiveIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetEffectiveIamPoliciesRequest + * @property {string|null} [scope] BatchGetEffectiveIamPoliciesRequest scope + * @property {Array.|null} [names] BatchGetEffectiveIamPoliciesRequest names + */ + + /** + * Constructs a new BatchGetEffectiveIamPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetEffectiveIamPoliciesRequest. + * @implements IBatchGetEffectiveIamPoliciesRequest + * @constructor + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + */ + function BatchGetEffectiveIamPoliciesRequest(properties) { + this.names = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchGetEffectiveIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + */ + BatchGetEffectiveIamPoliciesRequest.prototype.scope = ""; + + /** + * BatchGetEffectiveIamPoliciesRequest names. + * @member {Array.} names + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + */ + BatchGetEffectiveIamPoliciesRequest.prototype.names = $util.emptyArray; + + /** + * Creates a new BatchGetEffectiveIamPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest instance + */ + BatchGetEffectiveIamPoliciesRequest.create = function create(properties) { + return new BatchGetEffectiveIamPoliciesRequest(properties); + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); + return writer; + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetEffectiveIamPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 3: { + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetEffectiveIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetEffectiveIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetEffectiveIamPoliciesRequest message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetEffectiveIamPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; + } + return null; + }; + + /** + * Creates a BatchGetEffectiveIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} BatchGetEffectiveIamPoliciesRequest + */ + BatchGetEffectiveIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); + } + return message; + }; + + /** + * Creates a plain object from a BatchGetEffectiveIamPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest} message BatchGetEffectiveIamPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetEffectiveIamPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.names = []; + if (options.defaults) + object.scope = ""; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; + } + return object; + }; + + /** + * Converts this BatchGetEffectiveIamPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchGetEffectiveIamPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchGetEffectiveIamPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetEffectiveIamPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest"; + }; + + return BatchGetEffectiveIamPoliciesRequest; + })(); + + v1.BatchGetEffectiveIamPoliciesResponse = (function() { + + /** + * Properties of a BatchGetEffectiveIamPoliciesResponse. + * @memberof google.cloud.asset.v1 + * @interface IBatchGetEffectiveIamPoliciesResponse + * @property {Array.|null} [policyResults] BatchGetEffectiveIamPoliciesResponse policyResults + */ + + /** + * Constructs a new BatchGetEffectiveIamPoliciesResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a BatchGetEffectiveIamPoliciesResponse. + * @implements IBatchGetEffectiveIamPoliciesResponse + * @constructor + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set + */ + function BatchGetEffectiveIamPoliciesResponse(properties) { + this.policyResults = []; + 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]]; + } + + /** + * BatchGetEffectiveIamPoliciesResponse policyResults. + * @member {Array.} policyResults + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @instance + */ + BatchGetEffectiveIamPoliciesResponse.prototype.policyResults = $util.emptyArray; + + /** + * Creates a new BatchGetEffectiveIamPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse instance + */ + BatchGetEffectiveIamPoliciesResponse.create = function create(properties) { + return new BatchGetEffectiveIamPoliciesResponse(properties); + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policyResults != null && message.policyResults.length) + for (var i = 0; i < message.policyResults.length; ++i) + $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.encode(message.policyResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetEffectiveIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetEffectiveIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetEffectiveIamPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.policyResults && message.policyResults.length)) + message.policyResults = []; + message.policyResults.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetEffectiveIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetEffectiveIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetEffectiveIamPoliciesResponse message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetEffectiveIamPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policyResults != null && message.hasOwnProperty("policyResults")) { + if (!Array.isArray(message.policyResults)) + return "policyResults: array expected"; + for (var i = 0; i < message.policyResults.length; ++i) { + var error = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify(message.policyResults[i]); + if (error) + return "policyResults." + error; + } + } + return null; + }; + + /** + * Creates a BatchGetEffectiveIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} BatchGetEffectiveIamPoliciesResponse + */ + BatchGetEffectiveIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse(); + if (object.policyResults) { + if (!Array.isArray(object.policyResults)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.policyResults: array expected"); + message.policyResults = []; + for (var i = 0; i < object.policyResults.length; ++i) { + if (typeof object.policyResults[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.policyResults: object expected"); + message.policyResults[i] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.fromObject(object.policyResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchGetEffectiveIamPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse} message BatchGetEffectiveIamPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetEffectiveIamPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policyResults = []; + if (message.policyResults && message.policyResults.length) { + object.policyResults = []; + for (var j = 0; j < message.policyResults.length; ++j) + object.policyResults[j] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.toObject(message.policyResults[j], options); + } + return object; + }; + + /** + * Converts this BatchGetEffectiveIamPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchGetEffectiveIamPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchGetEffectiveIamPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetEffectiveIamPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse"; + }; + + BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy = (function() { + + /** + * Properties of an EffectiveIamPolicy. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @interface IEffectiveIamPolicy + * @property {string|null} [fullResourceName] EffectiveIamPolicy fullResourceName + * @property {Array.|null} [policies] EffectiveIamPolicy policies + */ + + /** + * Constructs a new EffectiveIamPolicy. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse + * @classdesc Represents an EffectiveIamPolicy. + * @implements IEffectiveIamPolicy + * @constructor + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy=} [properties] Properties to set + */ + function EffectiveIamPolicy(properties) { + this.policies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EffectiveIamPolicy fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + */ + EffectiveIamPolicy.prototype.fullResourceName = ""; + + /** + * EffectiveIamPolicy policies. + * @member {Array.} policies + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + */ + EffectiveIamPolicy.prototype.policies = $util.emptyArray; + + /** + * Creates a new EffectiveIamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy instance + */ + EffectiveIamPolicy.create = function create(properties) { + return new EffectiveIamPolicy(properties); + }; + + /** + * Encodes the specified EffectiveIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy} message EffectiveIamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveIamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.policies != null && message.policies.length) + for (var i = 0; i < message.policies.length; ++i) + $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.encode(message.policies[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EffectiveIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.IEffectiveIamPolicy} message EffectiveIamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveIamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveIamPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fullResourceName = reader.string(); + break; + } + case 2: { + if (!(message.policies && message.policies.length)) + message.policies = []; + message.policies.push($root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EffectiveIamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveIamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EffectiveIamPolicy message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EffectiveIamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + if (message.policies != null && message.hasOwnProperty("policies")) { + if (!Array.isArray(message.policies)) + return "policies: array expected"; + for (var i = 0; i < message.policies.length; ++i) { + var error = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify(message.policies[i]); + if (error) + return "policies." + error; + } + } + return null; + }; + + /** + * Creates an EffectiveIamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} EffectiveIamPolicy + */ + EffectiveIamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.policies) { + if (!Array.isArray(object.policies)) + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies: array expected"); + message.policies = []; + for (var i = 0; i < object.policies.length; ++i) { + if (typeof object.policies[i] !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.policies: object expected"); + message.policies[i] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.fromObject(object.policies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EffectiveIamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy} message EffectiveIamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EffectiveIamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policies = []; + if (options.defaults) + object.fullResourceName = ""; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.policies && message.policies.length) { + object.policies = []; + for (var j = 0; j < message.policies.length; ++j) + object.policies[j] = $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.toObject(message.policies[j], options); + } + return object; + }; + + /** + * Converts this EffectiveIamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @instance + * @returns {Object.} JSON object + */ + EffectiveIamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EffectiveIamPolicy + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EffectiveIamPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy"; + }; + + EffectiveIamPolicy.PolicyInfo = (function() { + + /** + * Properties of a PolicyInfo. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @interface IPolicyInfo + * @property {string|null} [attachedResource] PolicyInfo attachedResource + * @property {google.iam.v1.IPolicy|null} [policy] PolicyInfo policy + */ + + /** + * Constructs a new PolicyInfo. + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy + * @classdesc Represents a PolicyInfo. + * @implements IPolicyInfo + * @constructor + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo=} [properties] Properties to set + */ + function PolicyInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyInfo attachedResource. + * @member {string} attachedResource + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + */ + PolicyInfo.prototype.attachedResource = ""; + + /** + * PolicyInfo policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + */ + PolicyInfo.prototype.policy = null; + + /** + * Creates a new PolicyInfo instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo=} [properties] Properties to set + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo instance + */ + PolicyInfo.create = function create(properties) { + return new PolicyInfo(properties); + }; + + /** + * Encodes the specified PolicyInfo message. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo} message PolicyInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResource != null && Object.hasOwnProperty.call(message, "attachedResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyInfo message, length delimited. Does not implicitly {@link google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.IPolicyInfo} message PolicyInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attachedResource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyInfo message. + * @function verify + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + if (!$util.isString(message.attachedResource)) + return "attachedResource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + return null; + }; + + /** + * Creates a PolicyInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} PolicyInfo + */ + PolicyInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo) + return object; + var message = new $root.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo(); + if (object.attachedResource != null) + message.attachedResource = String(object.attachedResource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + return message; + }; + + /** + * Creates a plain object from a PolicyInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo} message PolicyInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.attachedResource = ""; + object.policy = null; + } + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + object.attachedResource = message.attachedResource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + return object; + }; + + /** + * Converts this PolicyInfo to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @instance + * @returns {Object.} JSON object + */ + PolicyInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyInfo + * @function getTypeUrl + * @memberof google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse.EffectiveIamPolicy.PolicyInfo"; + }; + + return PolicyInfo; + })(); + + return EffectiveIamPolicy; + })(); + + return BatchGetEffectiveIamPoliciesResponse; + })(); + + v1.AnalyzerOrgPolicy = (function() { + + /** + * Properties of an AnalyzerOrgPolicy. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzerOrgPolicy + * @property {string|null} [attachedResource] AnalyzerOrgPolicy attachedResource + * @property {string|null} [appliedResource] AnalyzerOrgPolicy appliedResource + * @property {Array.|null} [rules] AnalyzerOrgPolicy rules + * @property {boolean|null} [inheritFromParent] AnalyzerOrgPolicy inheritFromParent + * @property {boolean|null} [reset] AnalyzerOrgPolicy reset + */ + + /** + * Constructs a new AnalyzerOrgPolicy. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzerOrgPolicy. + * @implements IAnalyzerOrgPolicy + * @constructor + * @param {google.cloud.asset.v1.IAnalyzerOrgPolicy=} [properties] Properties to set + */ + function AnalyzerOrgPolicy(properties) { + this.rules = []; + 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]]; + } + + /** + * AnalyzerOrgPolicy attachedResource. + * @member {string} attachedResource + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @instance + */ + AnalyzerOrgPolicy.prototype.attachedResource = ""; + + /** + * AnalyzerOrgPolicy appliedResource. + * @member {string} appliedResource + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @instance + */ + AnalyzerOrgPolicy.prototype.appliedResource = ""; + + /** + * AnalyzerOrgPolicy rules. + * @member {Array.} rules + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @instance + */ + AnalyzerOrgPolicy.prototype.rules = $util.emptyArray; + + /** + * AnalyzerOrgPolicy inheritFromParent. + * @member {boolean} inheritFromParent + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @instance + */ + AnalyzerOrgPolicy.prototype.inheritFromParent = false; + + /** + * AnalyzerOrgPolicy reset. + * @member {boolean} reset + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @instance + */ + AnalyzerOrgPolicy.prototype.reset = false; + + /** + * Creates a new AnalyzerOrgPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {google.cloud.asset.v1.IAnalyzerOrgPolicy=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy} AnalyzerOrgPolicy instance + */ + AnalyzerOrgPolicy.create = function create(properties) { + return new AnalyzerOrgPolicy(properties); + }; + + /** + * Encodes the specified AnalyzerOrgPolicy message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {google.cloud.asset.v1.IAnalyzerOrgPolicy} message AnalyzerOrgPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzerOrgPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResource != null && Object.hasOwnProperty.call(message, "attachedResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResource); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.encode(message.rules[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inheritFromParent != null && Object.hasOwnProperty.call(message, "inheritFromParent")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.inheritFromParent); + if (message.reset != null && Object.hasOwnProperty.call(message, "reset")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.reset); + if (message.appliedResource != null && Object.hasOwnProperty.call(message, "appliedResource")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.appliedResource); + return writer; + }; + + /** + * Encodes the specified AnalyzerOrgPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {google.cloud.asset.v1.IAnalyzerOrgPolicy} message AnalyzerOrgPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzerOrgPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzerOrgPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy} AnalyzerOrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzerOrgPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attachedResource = reader.string(); + break; + } + case 5: { + message.appliedResource = reader.string(); + break; + } + case 2: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.decode(reader, reader.uint32())); + break; + } + case 3: { + message.inheritFromParent = reader.bool(); + break; + } + case 4: { + message.reset = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzerOrgPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy} AnalyzerOrgPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzerOrgPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzerOrgPolicy message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzerOrgPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + if (!$util.isString(message.attachedResource)) + return "attachedResource: string expected"; + if (message.appliedResource != null && message.hasOwnProperty("appliedResource")) + if (!$util.isString(message.appliedResource)) + return "appliedResource: string expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + if (typeof message.inheritFromParent !== "boolean") + return "inheritFromParent: boolean expected"; + if (message.reset != null && message.hasOwnProperty("reset")) + if (typeof message.reset !== "boolean") + return "reset: boolean expected"; + return null; + }; + + /** + * Creates an AnalyzerOrgPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy} AnalyzerOrgPolicy + */ + AnalyzerOrgPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzerOrgPolicy) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicy(); + if (object.attachedResource != null) + message.attachedResource = String(object.attachedResource); + if (object.appliedResource != null) + message.appliedResource = String(object.appliedResource); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicy.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicy.rules: object expected"); + message.rules[i] = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.fromObject(object.rules[i]); + } + } + if (object.inheritFromParent != null) + message.inheritFromParent = Boolean(object.inheritFromParent); + if (object.reset != null) + message.reset = Boolean(object.reset); + return message; + }; + + /** + * Creates a plain object from an AnalyzerOrgPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy} message AnalyzerOrgPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzerOrgPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) { + object.attachedResource = ""; + object.inheritFromParent = false; + object.reset = false; + object.appliedResource = ""; + } + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + object.attachedResource = message.attachedResource; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.toObject(message.rules[j], options); + } + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + object.inheritFromParent = message.inheritFromParent; + if (message.reset != null && message.hasOwnProperty("reset")) + object.reset = message.reset; + if (message.appliedResource != null && message.hasOwnProperty("appliedResource")) + object.appliedResource = message.appliedResource; + return object; + }; + + /** + * Converts this AnalyzerOrgPolicy to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @instance + * @returns {Object.} JSON object + */ + AnalyzerOrgPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzerOrgPolicy + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzerOrgPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzerOrgPolicy"; + }; + + AnalyzerOrgPolicy.Rule = (function() { + + /** + * Properties of a Rule. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @interface IRule + * @property {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues|null} [values] Rule values + * @property {boolean|null} [allowAll] Rule allowAll + * @property {boolean|null} [denyAll] Rule denyAll + * @property {boolean|null} [enforce] Rule enforce + * @property {google.type.IExpr|null} [condition] Rule condition + * @property {google.cloud.asset.v1.IConditionEvaluation|null} [conditionEvaluation] Rule conditionEvaluation + */ + + /** + * Constructs a new Rule. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy + * @classdesc Represents a Rule. + * @implements IRule + * @constructor + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.IRule=} [properties] Properties to set + */ + function Rule(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]]; + } + + /** + * Rule values. + * @member {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues|null|undefined} values + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @instance + */ + Rule.prototype.values = null; + + /** + * Rule allowAll. + * @member {boolean|null|undefined} allowAll + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @instance + */ + Rule.prototype.allowAll = null; + + /** + * Rule denyAll. + * @member {boolean|null|undefined} denyAll + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @instance + */ + Rule.prototype.denyAll = null; + + /** + * Rule enforce. + * @member {boolean|null|undefined} enforce + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @instance + */ + Rule.prototype.enforce = null; + + /** + * Rule condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @instance + */ + Rule.prototype.condition = null; + + /** + * Rule conditionEvaluation. + * @member {google.cloud.asset.v1.IConditionEvaluation|null|undefined} conditionEvaluation + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @instance + */ + Rule.prototype.conditionEvaluation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Rule kind. + * @member {"values"|"allowAll"|"denyAll"|"enforce"|undefined} kind + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @instance + */ + Object.defineProperty(Rule.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["values", "allowAll", "denyAll", "enforce"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Rule instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.IRule=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule} Rule instance + */ + Rule.create = function create(properties) { + return new Rule(properties); + }; + + /** + * Encodes the specified Rule message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.IRule} message Rule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && Object.hasOwnProperty.call(message, "values")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.encode(message.values, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowAll != null && Object.hasOwnProperty.call(message, "allowAll")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowAll); + if (message.denyAll != null && Object.hasOwnProperty.call(message, "denyAll")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.denyAll); + if (message.enforce != null && Object.hasOwnProperty.call(message, "enforce")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.enforce); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.conditionEvaluation != null && Object.hasOwnProperty.call(message, "conditionEvaluation")) + $root.google.cloud.asset.v1.ConditionEvaluation.encode(message.conditionEvaluation, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Rule message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.IRule} message Rule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Rule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Rule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule} Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.values = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.decode(reader, reader.uint32()); + break; + } + case 4: { + message.allowAll = reader.bool(); + break; + } + case 5: { + message.denyAll = reader.bool(); + break; + } + case 6: { + message.enforce = reader.bool(); + break; + } + case 7: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + case 8: { + message.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Rule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule} Rule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Rule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Rule message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Rule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.values != null && message.hasOwnProperty("values")) { + properties.kind = 1; + { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.verify(message.values); + if (error) + return "values." + error; + } + } + if (message.allowAll != null && message.hasOwnProperty("allowAll")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.allowAll !== "boolean") + return "allowAll: boolean expected"; + } + if (message.denyAll != null && message.hasOwnProperty("denyAll")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.denyAll !== "boolean") + return "denyAll: boolean expected"; + } + if (message.enforce != null && message.hasOwnProperty("enforce")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.enforce !== "boolean") + return "enforce: boolean expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + if (message.conditionEvaluation != null && message.hasOwnProperty("conditionEvaluation")) { + var error = $root.google.cloud.asset.v1.ConditionEvaluation.verify(message.conditionEvaluation); + if (error) + return "conditionEvaluation." + error; + } + return null; + }; + + /** + * Creates a Rule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule} Rule + */ + Rule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule(); + if (object.values != null) { + if (typeof object.values !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.values: object expected"); + message.values = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.fromObject(object.values); + } + if (object.allowAll != null) + message.allowAll = Boolean(object.allowAll); + if (object.denyAll != null) + message.denyAll = Boolean(object.denyAll); + if (object.enforce != null) + message.enforce = Boolean(object.enforce); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + if (object.conditionEvaluation != null) { + if (typeof object.conditionEvaluation !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.conditionEvaluation: object expected"); + message.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.fromObject(object.conditionEvaluation); + } + return message; + }; + + /** + * Creates a plain object from a Rule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule} message Rule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Rule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.condition = null; + object.conditionEvaluation = null; + } + if (message.values != null && message.hasOwnProperty("values")) { + object.values = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.toObject(message.values, options); + if (options.oneofs) + object.kind = "values"; + } + if (message.allowAll != null && message.hasOwnProperty("allowAll")) { + object.allowAll = message.allowAll; + if (options.oneofs) + object.kind = "allowAll"; + } + if (message.denyAll != null && message.hasOwnProperty("denyAll")) { + object.denyAll = message.denyAll; + if (options.oneofs) + object.kind = "denyAll"; + } + if (message.enforce != null && message.hasOwnProperty("enforce")) { + object.enforce = message.enforce; + if (options.oneofs) + object.kind = "enforce"; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + if (message.conditionEvaluation != null && message.hasOwnProperty("conditionEvaluation")) + object.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.toObject(message.conditionEvaluation, options); + return object; + }; + + /** + * Converts this Rule to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @instance + * @returns {Object.} JSON object + */ + Rule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Rule + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Rule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzerOrgPolicy.Rule"; + }; + + Rule.StringValues = (function() { + + /** + * Properties of a StringValues. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @interface IStringValues + * @property {Array.|null} [allowedValues] StringValues allowedValues + * @property {Array.|null} [deniedValues] StringValues deniedValues + */ + + /** + * Constructs a new StringValues. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule + * @classdesc Represents a StringValues. + * @implements IStringValues + * @constructor + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues=} [properties] Properties to set + */ + function StringValues(properties) { + this.allowedValues = []; + this.deniedValues = []; + 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]]; + } + + /** + * StringValues allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @instance + */ + StringValues.prototype.allowedValues = $util.emptyArray; + + /** + * StringValues deniedValues. + * @member {Array.} deniedValues + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @instance + */ + StringValues.prototype.deniedValues = $util.emptyArray; + + /** + * Creates a new StringValues instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues} StringValues instance + */ + StringValues.create = function create(properties) { + return new StringValues(properties); + }; + + /** + * Encodes the specified StringValues message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues} message StringValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValues.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + if (message.deniedValues != null && message.deniedValues.length) + for (var i = 0; i < message.deniedValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedValues[i]); + return writer; + }; + + /** + * Encodes the specified StringValues message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.IStringValues} message StringValues message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValues.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValues message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues} StringValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValues.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + case 2: { + if (!(message.deniedValues && message.deniedValues.length)) + message.deniedValues = []; + message.deniedValues.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValues message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues} StringValues + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValues.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValues message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValues.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + if (message.deniedValues != null && message.hasOwnProperty("deniedValues")) { + if (!Array.isArray(message.deniedValues)) + return "deniedValues: array expected"; + for (var i = 0; i < message.deniedValues.length; ++i) + if (!$util.isString(message.deniedValues[i])) + return "deniedValues: string[] expected"; + } + return null; + }; + + /** + * Creates a StringValues message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues} StringValues + */ + StringValues.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + if (object.deniedValues) { + if (!Array.isArray(object.deniedValues)) + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues.deniedValues: array expected"); + message.deniedValues = []; + for (var i = 0; i < object.deniedValues.length; ++i) + message.deniedValues[i] = String(object.deniedValues[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringValues message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues} message StringValues + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValues.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedValues = []; + object.deniedValues = []; + } + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + if (message.deniedValues && message.deniedValues.length) { + object.deniedValues = []; + for (var j = 0; j < message.deniedValues.length; ++j) + object.deniedValues[j] = message.deniedValues[j]; + } + return object; + }; + + /** + * Converts this StringValues to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @instance + * @returns {Object.} JSON object + */ + StringValues.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringValues + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzerOrgPolicy.Rule.StringValues"; + }; + + return StringValues; + })(); + + return Rule; + })(); + + return AnalyzerOrgPolicy; + })(); + + v1.AnalyzerOrgPolicyConstraint = (function() { + + /** + * Properties of an AnalyzerOrgPolicyConstraint. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzerOrgPolicyConstraint + * @property {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint|null} [googleDefinedConstraint] AnalyzerOrgPolicyConstraint googleDefinedConstraint + * @property {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint|null} [customConstraint] AnalyzerOrgPolicyConstraint customConstraint + */ + + /** + * Constructs a new AnalyzerOrgPolicyConstraint. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzerOrgPolicyConstraint. + * @implements IAnalyzerOrgPolicyConstraint + * @constructor + * @param {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint=} [properties] Properties to set + */ + function AnalyzerOrgPolicyConstraint(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]]; + } + + /** + * AnalyzerOrgPolicyConstraint googleDefinedConstraint. + * @member {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint|null|undefined} googleDefinedConstraint + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @instance + */ + AnalyzerOrgPolicyConstraint.prototype.googleDefinedConstraint = null; + + /** + * AnalyzerOrgPolicyConstraint customConstraint. + * @member {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint|null|undefined} customConstraint + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @instance + */ + AnalyzerOrgPolicyConstraint.prototype.customConstraint = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnalyzerOrgPolicyConstraint constraintDefinition. + * @member {"googleDefinedConstraint"|"customConstraint"|undefined} constraintDefinition + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @instance + */ + Object.defineProperty(AnalyzerOrgPolicyConstraint.prototype, "constraintDefinition", { + get: $util.oneOfGetter($oneOfFields = ["googleDefinedConstraint", "customConstraint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnalyzerOrgPolicyConstraint instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint} AnalyzerOrgPolicyConstraint instance + */ + AnalyzerOrgPolicyConstraint.create = function create(properties) { + return new AnalyzerOrgPolicyConstraint(properties); + }; + + /** + * Encodes the specified AnalyzerOrgPolicyConstraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint} message AnalyzerOrgPolicyConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzerOrgPolicyConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleDefinedConstraint != null && Object.hasOwnProperty.call(message, "googleDefinedConstraint")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.encode(message.googleDefinedConstraint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.customConstraint != null && Object.hasOwnProperty.call(message, "customConstraint")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.encode(message.customConstraint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzerOrgPolicyConstraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint} message AnalyzerOrgPolicyConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzerOrgPolicyConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzerOrgPolicyConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint} AnalyzerOrgPolicyConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzerOrgPolicyConstraint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.googleDefinedConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.decode(reader, reader.uint32()); + break; + } + case 2: { + message.customConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzerOrgPolicyConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint} AnalyzerOrgPolicyConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzerOrgPolicyConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzerOrgPolicyConstraint message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzerOrgPolicyConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.googleDefinedConstraint != null && message.hasOwnProperty("googleDefinedConstraint")) { + properties.constraintDefinition = 1; + { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.verify(message.googleDefinedConstraint); + if (error) + return "googleDefinedConstraint." + error; + } + } + if (message.customConstraint != null && message.hasOwnProperty("customConstraint")) { + if (properties.constraintDefinition === 1) + return "constraintDefinition: multiple values"; + properties.constraintDefinition = 1; + { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.verify(message.customConstraint); + if (error) + return "customConstraint." + error; + } + } + return null; + }; + + /** + * Creates an AnalyzerOrgPolicyConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint} AnalyzerOrgPolicyConstraint + */ + AnalyzerOrgPolicyConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint(); + if (object.googleDefinedConstraint != null) { + if (typeof object.googleDefinedConstraint !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.googleDefinedConstraint: object expected"); + message.googleDefinedConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.fromObject(object.googleDefinedConstraint); + } + if (object.customConstraint != null) { + if (typeof object.customConstraint !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.customConstraint: object expected"); + message.customConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.fromObject(object.customConstraint); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzerOrgPolicyConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint} message AnalyzerOrgPolicyConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzerOrgPolicyConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.googleDefinedConstraint != null && message.hasOwnProperty("googleDefinedConstraint")) { + object.googleDefinedConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.toObject(message.googleDefinedConstraint, options); + if (options.oneofs) + object.constraintDefinition = "googleDefinedConstraint"; + } + if (message.customConstraint != null && message.hasOwnProperty("customConstraint")) { + object.customConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.toObject(message.customConstraint, options); + if (options.oneofs) + object.constraintDefinition = "customConstraint"; + } + return object; + }; + + /** + * Converts this AnalyzerOrgPolicyConstraint to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @instance + * @returns {Object.} JSON object + */ + AnalyzerOrgPolicyConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzerOrgPolicyConstraint + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzerOrgPolicyConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzerOrgPolicyConstraint"; + }; + + AnalyzerOrgPolicyConstraint.Constraint = (function() { + + /** + * Properties of a Constraint. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @interface IConstraint + * @property {string|null} [name] Constraint name + * @property {string|null} [displayName] Constraint displayName + * @property {string|null} [description] Constraint description + * @property {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault|null} [constraintDefault] Constraint constraintDefault + * @property {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint|null} [listConstraint] Constraint listConstraint + * @property {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint|null} [booleanConstraint] Constraint booleanConstraint + */ + + /** + * Constructs a new Constraint. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @classdesc Represents a Constraint. + * @implements IConstraint + * @constructor + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint=} [properties] Properties to set + */ + function Constraint(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]]; + } + + /** + * Constraint name. + * @member {string} name + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @instance + */ + Constraint.prototype.name = ""; + + /** + * Constraint displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @instance + */ + Constraint.prototype.displayName = ""; + + /** + * Constraint description. + * @member {string} description + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @instance + */ + Constraint.prototype.description = ""; + + /** + * Constraint constraintDefault. + * @member {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault} constraintDefault + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @instance + */ + Constraint.prototype.constraintDefault = 0; + + /** + * Constraint listConstraint. + * @member {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint|null|undefined} listConstraint + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @instance + */ + Constraint.prototype.listConstraint = null; + + /** + * Constraint booleanConstraint. + * @member {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint|null|undefined} booleanConstraint + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @instance + */ + Constraint.prototype.booleanConstraint = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Constraint constraintType. + * @member {"listConstraint"|"booleanConstraint"|undefined} constraintType + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @instance + */ + Object.defineProperty(Constraint.prototype, "constraintType", { + get: $util.oneOfGetter($oneOfFields = ["listConstraint", "booleanConstraint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Constraint instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint} Constraint instance + */ + Constraint.create = function create(properties) { + return new Constraint(properties); + }; + + /** + * Encodes the specified Constraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint} message Constraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Constraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.constraintDefault != null && Object.hasOwnProperty.call(message, "constraintDefault")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.constraintDefault); + if (message.listConstraint != null && Object.hasOwnProperty.call(message, "listConstraint")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.encode(message.listConstraint, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.booleanConstraint != null && Object.hasOwnProperty.call(message, "booleanConstraint")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.encode(message.booleanConstraint, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Constraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.IConstraint} message Constraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Constraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Constraint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint} Constraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Constraint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.constraintDefault = reader.int32(); + break; + } + case 5: { + message.listConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.decode(reader, reader.uint32()); + break; + } + case 6: { + message.booleanConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Constraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint} Constraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Constraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Constraint message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Constraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.constraintDefault != null && message.hasOwnProperty("constraintDefault")) + switch (message.constraintDefault) { + default: + return "constraintDefault: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.listConstraint != null && message.hasOwnProperty("listConstraint")) { + properties.constraintType = 1; + { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.verify(message.listConstraint); + if (error) + return "listConstraint." + error; + } + } + if (message.booleanConstraint != null && message.hasOwnProperty("booleanConstraint")) { + if (properties.constraintType === 1) + return "constraintType: multiple values"; + properties.constraintType = 1; + { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.verify(message.booleanConstraint); + if (error) + return "booleanConstraint." + error; + } + } + return null; + }; + + /** + * Creates a Constraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint} Constraint + */ + Constraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.constraintDefault) { + default: + if (typeof object.constraintDefault === "number") { + message.constraintDefault = object.constraintDefault; + break; + } + break; + case "CONSTRAINT_DEFAULT_UNSPECIFIED": + case 0: + message.constraintDefault = 0; + break; + case "ALLOW": + case 1: + message.constraintDefault = 1; + break; + case "DENY": + case 2: + message.constraintDefault = 2; + break; + } + if (object.listConstraint != null) { + if (typeof object.listConstraint !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.listConstraint: object expected"); + message.listConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.fromObject(object.listConstraint); + } + if (object.booleanConstraint != null) { + if (typeof object.booleanConstraint !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.booleanConstraint: object expected"); + message.booleanConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.fromObject(object.booleanConstraint); + } + return message; + }; + + /** + * Creates a plain object from a Constraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint} message Constraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Constraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.constraintDefault = options.enums === String ? "CONSTRAINT_DEFAULT_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.constraintDefault != null && message.hasOwnProperty("constraintDefault")) + object.constraintDefault = options.enums === String ? $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault[message.constraintDefault] === undefined ? message.constraintDefault : $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault[message.constraintDefault] : message.constraintDefault; + if (message.listConstraint != null && message.hasOwnProperty("listConstraint")) { + object.listConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.toObject(message.listConstraint, options); + if (options.oneofs) + object.constraintType = "listConstraint"; + } + if (message.booleanConstraint != null && message.hasOwnProperty("booleanConstraint")) { + object.booleanConstraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.toObject(message.booleanConstraint, options); + if (options.oneofs) + object.constraintType = "booleanConstraint"; + } + return object; + }; + + /** + * Converts this Constraint to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @instance + * @returns {Object.} JSON object + */ + Constraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Constraint + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Constraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint"; + }; + + /** + * ConstraintDefault enum. + * @name google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ConstraintDefault + * @enum {number} + * @property {number} CONSTRAINT_DEFAULT_UNSPECIFIED=0 CONSTRAINT_DEFAULT_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + Constraint.ConstraintDefault = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONSTRAINT_DEFAULT_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + Constraint.ListConstraint = (function() { + + /** + * Properties of a ListConstraint. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @interface IListConstraint + * @property {boolean|null} [supportsIn] ListConstraint supportsIn + * @property {boolean|null} [supportsUnder] ListConstraint supportsUnder + */ + + /** + * Constructs a new ListConstraint. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @classdesc Represents a ListConstraint. + * @implements IListConstraint + * @constructor + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint=} [properties] Properties to set + */ + function ListConstraint(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]]; + } + + /** + * ListConstraint supportsIn. + * @member {boolean} supportsIn + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @instance + */ + ListConstraint.prototype.supportsIn = false; + + /** + * ListConstraint supportsUnder. + * @member {boolean} supportsUnder + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @instance + */ + ListConstraint.prototype.supportsUnder = false; + + /** + * Creates a new ListConstraint instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint} ListConstraint instance + */ + ListConstraint.create = function create(properties) { + return new ListConstraint(properties); + }; + + /** + * Encodes the specified ListConstraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint} message ListConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.supportsIn != null && Object.hasOwnProperty.call(message, "supportsIn")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.supportsIn); + if (message.supportsUnder != null && Object.hasOwnProperty.call(message, "supportsUnder")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.supportsUnder); + return writer; + }; + + /** + * Encodes the specified ListConstraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IListConstraint} message ListConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint} ListConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConstraint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.supportsIn = reader.bool(); + break; + } + case 2: { + message.supportsUnder = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint} ListConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListConstraint message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.supportsIn != null && message.hasOwnProperty("supportsIn")) + if (typeof message.supportsIn !== "boolean") + return "supportsIn: boolean expected"; + if (message.supportsUnder != null && message.hasOwnProperty("supportsUnder")) + if (typeof message.supportsUnder !== "boolean") + return "supportsUnder: boolean expected"; + return null; + }; + + /** + * Creates a ListConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint} ListConstraint + */ + ListConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint(); + if (object.supportsIn != null) + message.supportsIn = Boolean(object.supportsIn); + if (object.supportsUnder != null) + message.supportsUnder = Boolean(object.supportsUnder); + return message; + }; + + /** + * Creates a plain object from a ListConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint} message ListConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.supportsIn = false; + object.supportsUnder = false; + } + if (message.supportsIn != null && message.hasOwnProperty("supportsIn")) + object.supportsIn = message.supportsIn; + if (message.supportsUnder != null && message.hasOwnProperty("supportsUnder")) + object.supportsUnder = message.supportsUnder; + return object; + }; + + /** + * Converts this ListConstraint to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @instance + * @returns {Object.} JSON object + */ + ListConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListConstraint + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.ListConstraint"; + }; + + return ListConstraint; + })(); + + Constraint.BooleanConstraint = (function() { + + /** + * Properties of a BooleanConstraint. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @interface IBooleanConstraint + */ + + /** + * Constructs a new BooleanConstraint. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint + * @classdesc Represents a BooleanConstraint. + * @implements IBooleanConstraint + * @constructor + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint=} [properties] Properties to set + */ + function BooleanConstraint(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]]; + } + + /** + * Creates a new BooleanConstraint instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint} BooleanConstraint instance + */ + BooleanConstraint.create = function create(properties) { + return new BooleanConstraint(properties); + }; + + /** + * Encodes the specified BooleanConstraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint} message BooleanConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BooleanConstraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.IBooleanConstraint} message BooleanConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BooleanConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint} BooleanConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanConstraint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BooleanConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint} BooleanConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BooleanConstraint message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BooleanConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BooleanConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint} BooleanConstraint + */ + BooleanConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint) + return object; + return new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint(); + }; + + /** + * Creates a plain object from a BooleanConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint} message BooleanConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BooleanConstraint.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BooleanConstraint to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @instance + * @returns {Object.} JSON object + */ + BooleanConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BooleanConstraint + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BooleanConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.Constraint.BooleanConstraint"; + }; + + return BooleanConstraint; + })(); + + return Constraint; + })(); + + AnalyzerOrgPolicyConstraint.CustomConstraint = (function() { + + /** + * Properties of a CustomConstraint. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @interface ICustomConstraint + * @property {string|null} [name] CustomConstraint name + * @property {Array.|null} [resourceTypes] CustomConstraint resourceTypes + * @property {Array.|null} [methodTypes] CustomConstraint methodTypes + * @property {string|null} [condition] CustomConstraint condition + * @property {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType|null} [actionType] CustomConstraint actionType + * @property {string|null} [displayName] CustomConstraint displayName + * @property {string|null} [description] CustomConstraint description + */ + + /** + * Constructs a new CustomConstraint. + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint + * @classdesc Represents a CustomConstraint. + * @implements ICustomConstraint + * @constructor + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint=} [properties] Properties to set + */ + function CustomConstraint(properties) { + this.resourceTypes = []; + this.methodTypes = []; + 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]]; + } + + /** + * CustomConstraint name. + * @member {string} name + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @instance + */ + CustomConstraint.prototype.name = ""; + + /** + * CustomConstraint resourceTypes. + * @member {Array.} resourceTypes + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @instance + */ + CustomConstraint.prototype.resourceTypes = $util.emptyArray; + + /** + * CustomConstraint methodTypes. + * @member {Array.} methodTypes + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @instance + */ + CustomConstraint.prototype.methodTypes = $util.emptyArray; + + /** + * CustomConstraint condition. + * @member {string} condition + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @instance + */ + CustomConstraint.prototype.condition = ""; + + /** + * CustomConstraint actionType. + * @member {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType} actionType + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @instance + */ + CustomConstraint.prototype.actionType = 0; + + /** + * CustomConstraint displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @instance + */ + CustomConstraint.prototype.displayName = ""; + + /** + * CustomConstraint description. + * @member {string} description + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @instance + */ + CustomConstraint.prototype.description = ""; + + /** + * Creates a new CustomConstraint instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint} CustomConstraint instance + */ + CustomConstraint.create = function create(properties) { + return new CustomConstraint(properties); + }; + + /** + * Encodes the specified CustomConstraint message. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint} message CustomConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.resourceTypes != null && message.resourceTypes.length) + for (var i = 0; i < message.resourceTypes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceTypes[i]); + if (message.methodTypes != null && message.methodTypes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.methodTypes.length; ++i) + writer.int32(message.methodTypes[i]); + writer.ldelim(); + } + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.condition); + if (message.actionType != null && Object.hasOwnProperty.call(message, "actionType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.actionType); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + return writer; + }; + + /** + * Encodes the specified CustomConstraint message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.ICustomConstraint} message CustomConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint} CustomConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomConstraint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.resourceTypes && message.resourceTypes.length)) + message.resourceTypes = []; + message.resourceTypes.push(reader.string()); + break; + } + case 3: { + if (!(message.methodTypes && message.methodTypes.length)) + message.methodTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.methodTypes.push(reader.int32()); + } else + message.methodTypes.push(reader.int32()); + break; + } + case 4: { + message.condition = reader.string(); + break; + } + case 5: { + message.actionType = reader.int32(); + break; + } + case 6: { + message.displayName = reader.string(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint} CustomConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomConstraint message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomConstraint.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.resourceTypes != null && message.hasOwnProperty("resourceTypes")) { + if (!Array.isArray(message.resourceTypes)) + return "resourceTypes: array expected"; + for (var i = 0; i < message.resourceTypes.length; ++i) + if (!$util.isString(message.resourceTypes[i])) + return "resourceTypes: string[] expected"; + } + if (message.methodTypes != null && message.hasOwnProperty("methodTypes")) { + if (!Array.isArray(message.methodTypes)) + return "methodTypes: array expected"; + for (var i = 0; i < message.methodTypes.length; ++i) + switch (message.methodTypes[i]) { + default: + return "methodTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.condition != null && message.hasOwnProperty("condition")) + if (!$util.isString(message.condition)) + return "condition: string expected"; + if (message.actionType != null && message.hasOwnProperty("actionType")) + switch (message.actionType) { + default: + return "actionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a CustomConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint} CustomConstraint + */ + CustomConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint(); + if (object.name != null) + message.name = String(object.name); + if (object.resourceTypes) { + if (!Array.isArray(object.resourceTypes)) + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.resourceTypes: array expected"); + message.resourceTypes = []; + for (var i = 0; i < object.resourceTypes.length; ++i) + message.resourceTypes[i] = String(object.resourceTypes[i]); + } + if (object.methodTypes) { + if (!Array.isArray(object.methodTypes)) + throw TypeError(".google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.methodTypes: array expected"); + message.methodTypes = []; + for (var i = 0; i < object.methodTypes.length; ++i) + switch (object.methodTypes[i]) { + default: + if (typeof object.methodTypes[i] === "number") { + message.methodTypes[i] = object.methodTypes[i]; + break; + } + case "METHOD_TYPE_UNSPECIFIED": + case 0: + message.methodTypes[i] = 0; + break; + case "CREATE": + case 1: + message.methodTypes[i] = 1; + break; + case "UPDATE": + case 2: + message.methodTypes[i] = 2; + break; + case "DELETE": + case 3: + message.methodTypes[i] = 3; + break; + } + } + if (object.condition != null) + message.condition = String(object.condition); + switch (object.actionType) { + default: + if (typeof object.actionType === "number") { + message.actionType = object.actionType; + break; + } + break; + case "ACTION_TYPE_UNSPECIFIED": + case 0: + message.actionType = 0; + break; + case "ALLOW": + case 1: + message.actionType = 1; + break; + case "DENY": + case 2: + message.actionType = 2; + break; + } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a CustomConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint} message CustomConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resourceTypes = []; + object.methodTypes = []; + } + if (options.defaults) { + object.name = ""; + object.condition = ""; + object.actionType = options.enums === String ? "ACTION_TYPE_UNSPECIFIED" : 0; + object.displayName = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceTypes && message.resourceTypes.length) { + object.resourceTypes = []; + for (var j = 0; j < message.resourceTypes.length; ++j) + object.resourceTypes[j] = message.resourceTypes[j]; + } + if (message.methodTypes && message.methodTypes.length) { + object.methodTypes = []; + for (var j = 0; j < message.methodTypes.length; ++j) + object.methodTypes[j] = options.enums === String ? $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType[message.methodTypes[j]] === undefined ? message.methodTypes[j] : $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType[message.methodTypes[j]] : message.methodTypes[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = message.condition; + if (message.actionType != null && message.hasOwnProperty("actionType")) + object.actionType = options.enums === String ? $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType[message.actionType] === undefined ? message.actionType : $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType[message.actionType] : message.actionType; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this CustomConstraint to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @instance + * @returns {Object.} JSON object + */ + CustomConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomConstraint + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint"; + }; + + /** + * MethodType enum. + * @name google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.MethodType + * @enum {number} + * @property {number} METHOD_TYPE_UNSPECIFIED=0 METHOD_TYPE_UNSPECIFIED value + * @property {number} CREATE=1 CREATE value + * @property {number} UPDATE=2 UPDATE value + * @property {number} DELETE=3 DELETE value + */ + CustomConstraint.MethodType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METHOD_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATE"] = 1; + values[valuesById[2] = "UPDATE"] = 2; + values[valuesById[3] = "DELETE"] = 3; + return values; + })(); + + /** + * ActionType enum. + * @name google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.CustomConstraint.ActionType + * @enum {number} + * @property {number} ACTION_TYPE_UNSPECIFIED=0 ACTION_TYPE_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + CustomConstraint.ActionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return CustomConstraint; + })(); + + return AnalyzerOrgPolicyConstraint; + })(); + + v1.AnalyzeOrgPoliciesRequest = (function() { + + /** + * Properties of an AnalyzeOrgPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeOrgPoliciesRequest + * @property {string|null} [scope] AnalyzeOrgPoliciesRequest scope + * @property {string|null} [constraint] AnalyzeOrgPoliciesRequest constraint + * @property {string|null} [filter] AnalyzeOrgPoliciesRequest filter + * @property {number|null} [pageSize] AnalyzeOrgPoliciesRequest pageSize + * @property {string|null} [pageToken] AnalyzeOrgPoliciesRequest pageToken + */ + + /** + * Constructs a new AnalyzeOrgPoliciesRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeOrgPoliciesRequest. + * @implements IAnalyzeOrgPoliciesRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest=} [properties] Properties to set + */ + function AnalyzeOrgPoliciesRequest(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]]; + } + + /** + * AnalyzeOrgPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @instance + */ + AnalyzeOrgPoliciesRequest.prototype.scope = ""; + + /** + * AnalyzeOrgPoliciesRequest constraint. + * @member {string} constraint + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @instance + */ + AnalyzeOrgPoliciesRequest.prototype.constraint = ""; + + /** + * AnalyzeOrgPoliciesRequest filter. + * @member {string} filter + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @instance + */ + AnalyzeOrgPoliciesRequest.prototype.filter = ""; + + /** + * AnalyzeOrgPoliciesRequest pageSize. + * @member {number|null|undefined} pageSize + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @instance + */ + AnalyzeOrgPoliciesRequest.prototype.pageSize = null; + + /** + * AnalyzeOrgPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @instance + */ + AnalyzeOrgPoliciesRequest.prototype.pageToken = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnalyzeOrgPoliciesRequest _pageSize. + * @member {"pageSize"|undefined} _pageSize + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @instance + */ + Object.defineProperty(AnalyzeOrgPoliciesRequest.prototype, "_pageSize", { + get: $util.oneOfGetter($oneOfFields = ["pageSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnalyzeOrgPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesRequest} AnalyzeOrgPoliciesRequest instance + */ + AnalyzeOrgPoliciesRequest.create = function create(properties) { + return new AnalyzeOrgPoliciesRequest(properties); + }; + + /** + * Encodes the specified AnalyzeOrgPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest} message AnalyzeOrgPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified AnalyzeOrgPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest} message AnalyzeOrgPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeOrgPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesRequest} AnalyzeOrgPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.constraint = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeOrgPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesRequest} AnalyzeOrgPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeOrgPoliciesRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeOrgPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isString(message.constraint)) + return "constraint: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + properties._pageSize = 1; + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates an AnalyzeOrgPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesRequest} AnalyzeOrgPoliciesRequest + */ + AnalyzeOrgPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.constraint != null) + message.constraint = String(object.constraint); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from an AnalyzeOrgPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPoliciesRequest} message AnalyzeOrgPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeOrgPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scope = ""; + object.constraint = ""; + object.filter = ""; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + object.pageSize = message.pageSize; + if (options.oneofs) + object._pageSize = "pageSize"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this AnalyzeOrgPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeOrgPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeOrgPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeOrgPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPoliciesRequest"; + }; + + return AnalyzeOrgPoliciesRequest; + })(); + + v1.AnalyzeOrgPoliciesResponse = (function() { + + /** + * Properties of an AnalyzeOrgPoliciesResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeOrgPoliciesResponse + * @property {Array.|null} [orgPolicyResults] AnalyzeOrgPoliciesResponse orgPolicyResults + * @property {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null} [constraint] AnalyzeOrgPoliciesResponse constraint + * @property {string|null} [nextPageToken] AnalyzeOrgPoliciesResponse nextPageToken + */ + + /** + * Constructs a new AnalyzeOrgPoliciesResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeOrgPoliciesResponse. + * @implements IAnalyzeOrgPoliciesResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse=} [properties] Properties to set + */ + function AnalyzeOrgPoliciesResponse(properties) { + this.orgPolicyResults = []; + 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]]; + } + + /** + * AnalyzeOrgPoliciesResponse orgPolicyResults. + * @member {Array.} orgPolicyResults + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @instance + */ + AnalyzeOrgPoliciesResponse.prototype.orgPolicyResults = $util.emptyArray; + + /** + * AnalyzeOrgPoliciesResponse constraint. + * @member {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null|undefined} constraint + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @instance + */ + AnalyzeOrgPoliciesResponse.prototype.constraint = null; + + /** + * AnalyzeOrgPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @instance + */ + AnalyzeOrgPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new AnalyzeOrgPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse} AnalyzeOrgPoliciesResponse instance + */ + AnalyzeOrgPoliciesResponse.create = function create(properties) { + return new AnalyzeOrgPoliciesResponse(properties); + }; + + /** + * Encodes the specified AnalyzeOrgPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse} message AnalyzeOrgPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.orgPolicyResults != null && message.orgPolicyResults.length) + for (var i = 0; i < message.orgPolicyResults.length; ++i) + $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.encode(message.orgPolicyResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.encode(message.constraint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified AnalyzeOrgPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse} message AnalyzeOrgPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeOrgPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse} AnalyzeOrgPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.orgPolicyResults && message.orgPolicyResults.length)) + message.orgPolicyResults = []; + message.orgPolicyResults.push($root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeOrgPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse} AnalyzeOrgPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeOrgPoliciesResponse message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeOrgPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.orgPolicyResults != null && message.hasOwnProperty("orgPolicyResults")) { + if (!Array.isArray(message.orgPolicyResults)) + return "orgPolicyResults: array expected"; + for (var i = 0; i < message.orgPolicyResults.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.verify(message.orgPolicyResults[i]); + if (error) + return "orgPolicyResults." + error; + } + } + if (message.constraint != null && message.hasOwnProperty("constraint")) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.verify(message.constraint); + if (error) + return "constraint." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates an AnalyzeOrgPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse} AnalyzeOrgPoliciesResponse + */ + AnalyzeOrgPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse(); + if (object.orgPolicyResults) { + if (!Array.isArray(object.orgPolicyResults)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.orgPolicyResults: array expected"); + message.orgPolicyResults = []; + for (var i = 0; i < object.orgPolicyResults.length; ++i) { + if (typeof object.orgPolicyResults[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.orgPolicyResults: object expected"); + message.orgPolicyResults[i] = $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.fromObject(object.orgPolicyResults[i]); + } + } + if (object.constraint != null) { + if (typeof object.constraint !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.constraint: object expected"); + message.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.fromObject(object.constraint); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from an AnalyzeOrgPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse} message AnalyzeOrgPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeOrgPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.orgPolicyResults = []; + if (options.defaults) { + object.constraint = null; + object.nextPageToken = ""; + } + if (message.orgPolicyResults && message.orgPolicyResults.length) { + object.orgPolicyResults = []; + for (var j = 0; j < message.orgPolicyResults.length; ++j) + object.orgPolicyResults[j] = $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.toObject(message.orgPolicyResults[j], options); + } + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.toObject(message.constraint, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this AnalyzeOrgPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeOrgPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeOrgPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeOrgPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPoliciesResponse"; + }; + + AnalyzeOrgPoliciesResponse.OrgPolicyResult = (function() { + + /** + * Properties of an OrgPolicyResult. + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @interface IOrgPolicyResult + * @property {google.cloud.asset.v1.IAnalyzerOrgPolicy|null} [consolidatedPolicy] OrgPolicyResult consolidatedPolicy + * @property {Array.|null} [policyBundle] OrgPolicyResult policyBundle + * @property {string|null} [project] OrgPolicyResult project + * @property {Array.|null} [folders] OrgPolicyResult folders + * @property {string|null} [organization] OrgPolicyResult organization + */ + + /** + * Constructs a new OrgPolicyResult. + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse + * @classdesc Represents an OrgPolicyResult. + * @implements IOrgPolicyResult + * @constructor + * @param {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult=} [properties] Properties to set + */ + function OrgPolicyResult(properties) { + this.policyBundle = []; + this.folders = []; + 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]]; + } + + /** + * OrgPolicyResult consolidatedPolicy. + * @member {google.cloud.asset.v1.IAnalyzerOrgPolicy|null|undefined} consolidatedPolicy + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @instance + */ + OrgPolicyResult.prototype.consolidatedPolicy = null; + + /** + * OrgPolicyResult policyBundle. + * @member {Array.} policyBundle + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @instance + */ + OrgPolicyResult.prototype.policyBundle = $util.emptyArray; + + /** + * OrgPolicyResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @instance + */ + OrgPolicyResult.prototype.project = ""; + + /** + * OrgPolicyResult folders. + * @member {Array.} folders + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @instance + */ + OrgPolicyResult.prototype.folders = $util.emptyArray; + + /** + * OrgPolicyResult organization. + * @member {string} organization + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @instance + */ + OrgPolicyResult.prototype.organization = ""; + + /** + * Creates a new OrgPolicyResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult} OrgPolicyResult instance + */ + OrgPolicyResult.create = function create(properties) { + return new OrgPolicyResult(properties); + }; + + /** + * Encodes the specified OrgPolicyResult message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult} message OrgPolicyResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrgPolicyResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consolidatedPolicy != null && Object.hasOwnProperty.call(message, "consolidatedPolicy")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicy.encode(message.consolidatedPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.policyBundle != null && message.policyBundle.length) + for (var i = 0; i < message.policyBundle.length; ++i) + $root.google.cloud.asset.v1.AnalyzerOrgPolicy.encode(message.policyBundle[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.folders[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.organization); + return writer; + }; + + /** + * Encodes the specified OrgPolicyResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult} message OrgPolicyResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OrgPolicyResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OrgPolicyResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult} OrgPolicyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrgPolicyResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.policyBundle && message.policyBundle.length)) + message.policyBundle = []; + message.policyBundle.push($root.google.cloud.asset.v1.AnalyzerOrgPolicy.decode(reader, reader.uint32())); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 4: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + case 5: { + message.organization = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OrgPolicyResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult} OrgPolicyResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OrgPolicyResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OrgPolicyResult message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OrgPolicyResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.consolidatedPolicy != null && message.hasOwnProperty("consolidatedPolicy")) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.verify(message.consolidatedPolicy); + if (error) + return "consolidatedPolicy." + error; + } + if (message.policyBundle != null && message.hasOwnProperty("policyBundle")) { + if (!Array.isArray(message.policyBundle)) + return "policyBundle: array expected"; + for (var i = 0; i < message.policyBundle.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.verify(message.policyBundle[i]); + if (error) + return "policyBundle." + error; + } + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + return null; + }; + + /** + * Creates an OrgPolicyResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult} OrgPolicyResult + */ + OrgPolicyResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult(); + if (object.consolidatedPolicy != null) { + if (typeof object.consolidatedPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.consolidatedPolicy: object expected"); + message.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.fromObject(object.consolidatedPolicy); + } + if (object.policyBundle) { + if (!Array.isArray(object.policyBundle)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.policyBundle: array expected"); + message.policyBundle = []; + for (var i = 0; i < object.policyBundle.length; ++i) { + if (typeof object.policyBundle[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.policyBundle: object expected"); + message.policyBundle[i] = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.fromObject(object.policyBundle[i]); + } + } + if (object.project != null) + message.project = String(object.project); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + return message; + }; + + /** + * Creates a plain object from an OrgPolicyResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult} message OrgPolicyResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OrgPolicyResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policyBundle = []; + object.folders = []; + } + if (options.defaults) { + object.consolidatedPolicy = null; + object.project = ""; + object.organization = ""; + } + if (message.consolidatedPolicy != null && message.hasOwnProperty("consolidatedPolicy")) + object.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.toObject(message.consolidatedPolicy, options); + if (message.policyBundle && message.policyBundle.length) { + object.policyBundle = []; + for (var j = 0; j < message.policyBundle.length; ++j) + object.policyBundle[j] = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.toObject(message.policyBundle[j], options); + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + return object; + }; + + /** + * Converts this OrgPolicyResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @instance + * @returns {Object.} JSON object + */ + OrgPolicyResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OrgPolicyResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OrgPolicyResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult"; + }; + + return OrgPolicyResult; + })(); + + return AnalyzeOrgPoliciesResponse; + })(); + + v1.AnalyzeOrgPolicyGovernedContainersRequest = (function() { + + /** + * Properties of an AnalyzeOrgPolicyGovernedContainersRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeOrgPolicyGovernedContainersRequest + * @property {string|null} [scope] AnalyzeOrgPolicyGovernedContainersRequest scope + * @property {string|null} [constraint] AnalyzeOrgPolicyGovernedContainersRequest constraint + * @property {string|null} [filter] AnalyzeOrgPolicyGovernedContainersRequest filter + * @property {number|null} [pageSize] AnalyzeOrgPolicyGovernedContainersRequest pageSize + * @property {string|null} [pageToken] AnalyzeOrgPolicyGovernedContainersRequest pageToken + */ + + /** + * Constructs a new AnalyzeOrgPolicyGovernedContainersRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeOrgPolicyGovernedContainersRequest. + * @implements IAnalyzeOrgPolicyGovernedContainersRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest=} [properties] Properties to set + */ + function AnalyzeOrgPolicyGovernedContainersRequest(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]]; + } + + /** + * AnalyzeOrgPolicyGovernedContainersRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @instance + */ + AnalyzeOrgPolicyGovernedContainersRequest.prototype.scope = ""; + + /** + * AnalyzeOrgPolicyGovernedContainersRequest constraint. + * @member {string} constraint + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @instance + */ + AnalyzeOrgPolicyGovernedContainersRequest.prototype.constraint = ""; + + /** + * AnalyzeOrgPolicyGovernedContainersRequest filter. + * @member {string} filter + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @instance + */ + AnalyzeOrgPolicyGovernedContainersRequest.prototype.filter = ""; + + /** + * AnalyzeOrgPolicyGovernedContainersRequest pageSize. + * @member {number|null|undefined} pageSize + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @instance + */ + AnalyzeOrgPolicyGovernedContainersRequest.prototype.pageSize = null; + + /** + * AnalyzeOrgPolicyGovernedContainersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @instance + */ + AnalyzeOrgPolicyGovernedContainersRequest.prototype.pageToken = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnalyzeOrgPolicyGovernedContainersRequest _pageSize. + * @member {"pageSize"|undefined} _pageSize + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @instance + */ + Object.defineProperty(AnalyzeOrgPolicyGovernedContainersRequest.prototype, "_pageSize", { + get: $util.oneOfGetter($oneOfFields = ["pageSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnalyzeOrgPolicyGovernedContainersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest} AnalyzeOrgPolicyGovernedContainersRequest instance + */ + AnalyzeOrgPolicyGovernedContainersRequest.create = function create(properties) { + return new AnalyzeOrgPolicyGovernedContainersRequest(properties); + }; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedContainersRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest} message AnalyzeOrgPolicyGovernedContainersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPolicyGovernedContainersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedContainersRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest} message AnalyzeOrgPolicyGovernedContainersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPolicyGovernedContainersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeOrgPolicyGovernedContainersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest} AnalyzeOrgPolicyGovernedContainersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPolicyGovernedContainersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.constraint = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeOrgPolicyGovernedContainersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest} AnalyzeOrgPolicyGovernedContainersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPolicyGovernedContainersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeOrgPolicyGovernedContainersRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeOrgPolicyGovernedContainersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isString(message.constraint)) + return "constraint: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + properties._pageSize = 1; + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates an AnalyzeOrgPolicyGovernedContainersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest} AnalyzeOrgPolicyGovernedContainersRequest + */ + AnalyzeOrgPolicyGovernedContainersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.constraint != null) + message.constraint = String(object.constraint); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from an AnalyzeOrgPolicyGovernedContainersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest} message AnalyzeOrgPolicyGovernedContainersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeOrgPolicyGovernedContainersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scope = ""; + object.constraint = ""; + object.filter = ""; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + object.pageSize = message.pageSize; + if (options.oneofs) + object._pageSize = "pageSize"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this AnalyzeOrgPolicyGovernedContainersRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeOrgPolicyGovernedContainersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeOrgPolicyGovernedContainersRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeOrgPolicyGovernedContainersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest"; + }; + + return AnalyzeOrgPolicyGovernedContainersRequest; + })(); + + v1.AnalyzeOrgPolicyGovernedContainersResponse = (function() { + + /** + * Properties of an AnalyzeOrgPolicyGovernedContainersResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeOrgPolicyGovernedContainersResponse + * @property {Array.|null} [governedContainers] AnalyzeOrgPolicyGovernedContainersResponse governedContainers + * @property {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null} [constraint] AnalyzeOrgPolicyGovernedContainersResponse constraint + * @property {string|null} [nextPageToken] AnalyzeOrgPolicyGovernedContainersResponse nextPageToken + */ + + /** + * Constructs a new AnalyzeOrgPolicyGovernedContainersResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeOrgPolicyGovernedContainersResponse. + * @implements IAnalyzeOrgPolicyGovernedContainersResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse=} [properties] Properties to set + */ + function AnalyzeOrgPolicyGovernedContainersResponse(properties) { + this.governedContainers = []; + 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]]; + } + + /** + * AnalyzeOrgPolicyGovernedContainersResponse governedContainers. + * @member {Array.} governedContainers + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @instance + */ + AnalyzeOrgPolicyGovernedContainersResponse.prototype.governedContainers = $util.emptyArray; + + /** + * AnalyzeOrgPolicyGovernedContainersResponse constraint. + * @member {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null|undefined} constraint + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @instance + */ + AnalyzeOrgPolicyGovernedContainersResponse.prototype.constraint = null; + + /** + * AnalyzeOrgPolicyGovernedContainersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @instance + */ + AnalyzeOrgPolicyGovernedContainersResponse.prototype.nextPageToken = ""; + + /** + * Creates a new AnalyzeOrgPolicyGovernedContainersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse} AnalyzeOrgPolicyGovernedContainersResponse instance + */ + AnalyzeOrgPolicyGovernedContainersResponse.create = function create(properties) { + return new AnalyzeOrgPolicyGovernedContainersResponse(properties); + }; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedContainersResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse} message AnalyzeOrgPolicyGovernedContainersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPolicyGovernedContainersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.governedContainers != null && message.governedContainers.length) + for (var i = 0; i < message.governedContainers.length; ++i) + $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.encode(message.governedContainers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.encode(message.constraint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedContainersResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse} message AnalyzeOrgPolicyGovernedContainersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPolicyGovernedContainersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeOrgPolicyGovernedContainersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse} AnalyzeOrgPolicyGovernedContainersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPolicyGovernedContainersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.governedContainers && message.governedContainers.length)) + message.governedContainers = []; + message.governedContainers.push($root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.decode(reader, reader.uint32())); + break; + } + case 2: { + message.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeOrgPolicyGovernedContainersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse} AnalyzeOrgPolicyGovernedContainersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPolicyGovernedContainersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeOrgPolicyGovernedContainersResponse message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeOrgPolicyGovernedContainersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.governedContainers != null && message.hasOwnProperty("governedContainers")) { + if (!Array.isArray(message.governedContainers)) + return "governedContainers: array expected"; + for (var i = 0; i < message.governedContainers.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.verify(message.governedContainers[i]); + if (error) + return "governedContainers." + error; + } + } + if (message.constraint != null && message.hasOwnProperty("constraint")) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.verify(message.constraint); + if (error) + return "constraint." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates an AnalyzeOrgPolicyGovernedContainersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse} AnalyzeOrgPolicyGovernedContainersResponse + */ + AnalyzeOrgPolicyGovernedContainersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse(); + if (object.governedContainers) { + if (!Array.isArray(object.governedContainers)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governedContainers: array expected"); + message.governedContainers = []; + for (var i = 0; i < object.governedContainers.length; ++i) { + if (typeof object.governedContainers[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governedContainers: object expected"); + message.governedContainers[i] = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.fromObject(object.governedContainers[i]); + } + } + if (object.constraint != null) { + if (typeof object.constraint !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.constraint: object expected"); + message.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.fromObject(object.constraint); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from an AnalyzeOrgPolicyGovernedContainersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse} message AnalyzeOrgPolicyGovernedContainersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeOrgPolicyGovernedContainersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.governedContainers = []; + if (options.defaults) { + object.constraint = null; + object.nextPageToken = ""; + } + if (message.governedContainers && message.governedContainers.length) { + object.governedContainers = []; + for (var j = 0; j < message.governedContainers.length; ++j) + object.governedContainers[j] = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.toObject(message.governedContainers[j], options); + } + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.toObject(message.constraint, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this AnalyzeOrgPolicyGovernedContainersResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeOrgPolicyGovernedContainersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeOrgPolicyGovernedContainersResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeOrgPolicyGovernedContainersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse"; + }; + + AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer = (function() { + + /** + * Properties of a GovernedContainer. + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @interface IGovernedContainer + * @property {string|null} [fullResourceName] GovernedContainer fullResourceName + * @property {string|null} [parent] GovernedContainer parent + * @property {google.cloud.asset.v1.IAnalyzerOrgPolicy|null} [consolidatedPolicy] GovernedContainer consolidatedPolicy + * @property {Array.|null} [policyBundle] GovernedContainer policyBundle + * @property {string|null} [project] GovernedContainer project + * @property {Array.|null} [folders] GovernedContainer folders + * @property {string|null} [organization] GovernedContainer organization + * @property {Array.|null} [effectiveTags] GovernedContainer effectiveTags + */ + + /** + * Constructs a new GovernedContainer. + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse + * @classdesc Represents a GovernedContainer. + * @implements IGovernedContainer + * @constructor + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer=} [properties] Properties to set + */ + function GovernedContainer(properties) { + this.policyBundle = []; + this.folders = []; + this.effectiveTags = []; + 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]]; + } + + /** + * GovernedContainer fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + */ + GovernedContainer.prototype.fullResourceName = ""; + + /** + * GovernedContainer parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + */ + GovernedContainer.prototype.parent = ""; + + /** + * GovernedContainer consolidatedPolicy. + * @member {google.cloud.asset.v1.IAnalyzerOrgPolicy|null|undefined} consolidatedPolicy + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + */ + GovernedContainer.prototype.consolidatedPolicy = null; + + /** + * GovernedContainer policyBundle. + * @member {Array.} policyBundle + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + */ + GovernedContainer.prototype.policyBundle = $util.emptyArray; + + /** + * GovernedContainer project. + * @member {string} project + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + */ + GovernedContainer.prototype.project = ""; + + /** + * GovernedContainer folders. + * @member {Array.} folders + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + */ + GovernedContainer.prototype.folders = $util.emptyArray; + + /** + * GovernedContainer organization. + * @member {string} organization + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + */ + GovernedContainer.prototype.organization = ""; + + /** + * GovernedContainer effectiveTags. + * @member {Array.} effectiveTags + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + */ + GovernedContainer.prototype.effectiveTags = $util.emptyArray; + + /** + * Creates a new GovernedContainer instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer} GovernedContainer instance + */ + GovernedContainer.create = function create(properties) { + return new GovernedContainer(properties); + }; + + /** + * Encodes the specified GovernedContainer message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer} message GovernedContainer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernedContainer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.consolidatedPolicy != null && Object.hasOwnProperty.call(message, "consolidatedPolicy")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicy.encode(message.consolidatedPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.policyBundle != null && message.policyBundle.length) + for (var i = 0; i < message.policyBundle.length; ++i) + $root.google.cloud.asset.v1.AnalyzerOrgPolicy.encode(message.policyBundle[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.project); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.folders[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.organization); + if (message.effectiveTags != null && message.effectiveTags.length) + for (var i = 0; i < message.effectiveTags.length; ++i) + $root.google.cloud.asset.v1.EffectiveTagDetails.encode(message.effectiveTags[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GovernedContainer message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer} message GovernedContainer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernedContainer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GovernedContainer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer} GovernedContainer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernedContainer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fullResourceName = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.policyBundle && message.policyBundle.length)) + message.policyBundle = []; + message.policyBundle.push($root.google.cloud.asset.v1.AnalyzerOrgPolicy.decode(reader, reader.uint32())); + break; + } + case 5: { + message.project = reader.string(); + break; + } + case 6: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + case 7: { + message.organization = reader.string(); + break; + } + case 8: { + if (!(message.effectiveTags && message.effectiveTags.length)) + message.effectiveTags = []; + message.effectiveTags.push($root.google.cloud.asset.v1.EffectiveTagDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GovernedContainer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer} GovernedContainer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernedContainer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GovernedContainer message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GovernedContainer.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.consolidatedPolicy != null && message.hasOwnProperty("consolidatedPolicy")) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.verify(message.consolidatedPolicy); + if (error) + return "consolidatedPolicy." + error; + } + if (message.policyBundle != null && message.hasOwnProperty("policyBundle")) { + if (!Array.isArray(message.policyBundle)) + return "policyBundle: array expected"; + for (var i = 0; i < message.policyBundle.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.verify(message.policyBundle[i]); + if (error) + return "policyBundle." + error; + } + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.effectiveTags != null && message.hasOwnProperty("effectiveTags")) { + if (!Array.isArray(message.effectiveTags)) + return "effectiveTags: array expected"; + for (var i = 0; i < message.effectiveTags.length; ++i) { + var error = $root.google.cloud.asset.v1.EffectiveTagDetails.verify(message.effectiveTags[i]); + if (error) + return "effectiveTags." + error; + } + } + return null; + }; + + /** + * Creates a GovernedContainer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer} GovernedContainer + */ + GovernedContainer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.parent != null) + message.parent = String(object.parent); + if (object.consolidatedPolicy != null) { + if (typeof object.consolidatedPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.consolidatedPolicy: object expected"); + message.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.fromObject(object.consolidatedPolicy); + } + if (object.policyBundle) { + if (!Array.isArray(object.policyBundle)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policyBundle: array expected"); + message.policyBundle = []; + for (var i = 0; i < object.policyBundle.length; ++i) { + if (typeof object.policyBundle[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.policyBundle: object expected"); + message.policyBundle[i] = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.fromObject(object.policyBundle[i]); + } + } + if (object.project != null) + message.project = String(object.project); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + if (object.effectiveTags) { + if (!Array.isArray(object.effectiveTags)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.effectiveTags: array expected"); + message.effectiveTags = []; + for (var i = 0; i < object.effectiveTags.length; ++i) { + if (typeof object.effectiveTags[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer.effectiveTags: object expected"); + message.effectiveTags[i] = $root.google.cloud.asset.v1.EffectiveTagDetails.fromObject(object.effectiveTags[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GovernedContainer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer} message GovernedContainer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GovernedContainer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.policyBundle = []; + object.folders = []; + object.effectiveTags = []; + } + if (options.defaults) { + object.fullResourceName = ""; + object.parent = ""; + object.consolidatedPolicy = null; + object.project = ""; + object.organization = ""; + } + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.consolidatedPolicy != null && message.hasOwnProperty("consolidatedPolicy")) + object.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.toObject(message.consolidatedPolicy, options); + if (message.policyBundle && message.policyBundle.length) { + object.policyBundle = []; + for (var j = 0; j < message.policyBundle.length; ++j) + object.policyBundle[j] = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.toObject(message.policyBundle[j], options); + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.effectiveTags && message.effectiveTags.length) { + object.effectiveTags = []; + for (var j = 0; j < message.effectiveTags.length; ++j) + object.effectiveTags[j] = $root.google.cloud.asset.v1.EffectiveTagDetails.toObject(message.effectiveTags[j], options); + } + return object; + }; + + /** + * Converts this GovernedContainer to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @instance + * @returns {Object.} JSON object + */ + GovernedContainer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GovernedContainer + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GovernedContainer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer"; + }; + + return GovernedContainer; + })(); + + return AnalyzeOrgPolicyGovernedContainersResponse; + })(); + + v1.AnalyzeOrgPolicyGovernedAssetsRequest = (function() { + + /** + * Properties of an AnalyzeOrgPolicyGovernedAssetsRequest. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeOrgPolicyGovernedAssetsRequest + * @property {string|null} [scope] AnalyzeOrgPolicyGovernedAssetsRequest scope + * @property {string|null} [constraint] AnalyzeOrgPolicyGovernedAssetsRequest constraint + * @property {string|null} [filter] AnalyzeOrgPolicyGovernedAssetsRequest filter + * @property {number|null} [pageSize] AnalyzeOrgPolicyGovernedAssetsRequest pageSize + * @property {string|null} [pageToken] AnalyzeOrgPolicyGovernedAssetsRequest pageToken + */ + + /** + * Constructs a new AnalyzeOrgPolicyGovernedAssetsRequest. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeOrgPolicyGovernedAssetsRequest. + * @implements IAnalyzeOrgPolicyGovernedAssetsRequest + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest=} [properties] Properties to set + */ + function AnalyzeOrgPolicyGovernedAssetsRequest(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]]; + } + + /** + * AnalyzeOrgPolicyGovernedAssetsRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @instance + */ + AnalyzeOrgPolicyGovernedAssetsRequest.prototype.scope = ""; + + /** + * AnalyzeOrgPolicyGovernedAssetsRequest constraint. + * @member {string} constraint + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @instance + */ + AnalyzeOrgPolicyGovernedAssetsRequest.prototype.constraint = ""; + + /** + * AnalyzeOrgPolicyGovernedAssetsRequest filter. + * @member {string} filter + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @instance + */ + AnalyzeOrgPolicyGovernedAssetsRequest.prototype.filter = ""; + + /** + * AnalyzeOrgPolicyGovernedAssetsRequest pageSize. + * @member {number|null|undefined} pageSize + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @instance + */ + AnalyzeOrgPolicyGovernedAssetsRequest.prototype.pageSize = null; + + /** + * AnalyzeOrgPolicyGovernedAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @instance + */ + AnalyzeOrgPolicyGovernedAssetsRequest.prototype.pageToken = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnalyzeOrgPolicyGovernedAssetsRequest _pageSize. + * @member {"pageSize"|undefined} _pageSize + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @instance + */ + Object.defineProperty(AnalyzeOrgPolicyGovernedAssetsRequest.prototype, "_pageSize", { + get: $util.oneOfGetter($oneOfFields = ["pageSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnalyzeOrgPolicyGovernedAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest} AnalyzeOrgPolicyGovernedAssetsRequest instance + */ + AnalyzeOrgPolicyGovernedAssetsRequest.create = function create(properties) { + return new AnalyzeOrgPolicyGovernedAssetsRequest(properties); + }; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest} message AnalyzeOrgPolicyGovernedAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPolicyGovernedAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest} message AnalyzeOrgPolicyGovernedAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPolicyGovernedAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeOrgPolicyGovernedAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest} AnalyzeOrgPolicyGovernedAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPolicyGovernedAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.constraint = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeOrgPolicyGovernedAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest} AnalyzeOrgPolicyGovernedAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPolicyGovernedAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeOrgPolicyGovernedAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeOrgPolicyGovernedAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isString(message.constraint)) + return "constraint: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + properties._pageSize = 1; + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates an AnalyzeOrgPolicyGovernedAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest} AnalyzeOrgPolicyGovernedAssetsRequest + */ + AnalyzeOrgPolicyGovernedAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.constraint != null) + message.constraint = String(object.constraint); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from an AnalyzeOrgPolicyGovernedAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest} message AnalyzeOrgPolicyGovernedAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeOrgPolicyGovernedAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scope = ""; + object.constraint = ""; + object.filter = ""; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) { + object.pageSize = message.pageSize; + if (options.oneofs) + object._pageSize = "pageSize"; + } + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this AnalyzeOrgPolicyGovernedAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeOrgPolicyGovernedAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeOrgPolicyGovernedAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeOrgPolicyGovernedAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest"; + }; + + return AnalyzeOrgPolicyGovernedAssetsRequest; + })(); + + v1.AnalyzeOrgPolicyGovernedAssetsResponse = (function() { + + /** + * Properties of an AnalyzeOrgPolicyGovernedAssetsResponse. + * @memberof google.cloud.asset.v1 + * @interface IAnalyzeOrgPolicyGovernedAssetsResponse + * @property {Array.|null} [governedAssets] AnalyzeOrgPolicyGovernedAssetsResponse governedAssets + * @property {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null} [constraint] AnalyzeOrgPolicyGovernedAssetsResponse constraint + * @property {string|null} [nextPageToken] AnalyzeOrgPolicyGovernedAssetsResponse nextPageToken + */ + + /** + * Constructs a new AnalyzeOrgPolicyGovernedAssetsResponse. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AnalyzeOrgPolicyGovernedAssetsResponse. + * @implements IAnalyzeOrgPolicyGovernedAssetsResponse + * @constructor + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse=} [properties] Properties to set + */ + function AnalyzeOrgPolicyGovernedAssetsResponse(properties) { + this.governedAssets = []; + 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]]; + } + + /** + * AnalyzeOrgPolicyGovernedAssetsResponse governedAssets. + * @member {Array.} governedAssets + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @instance + */ + AnalyzeOrgPolicyGovernedAssetsResponse.prototype.governedAssets = $util.emptyArray; + + /** + * AnalyzeOrgPolicyGovernedAssetsResponse constraint. + * @member {google.cloud.asset.v1.IAnalyzerOrgPolicyConstraint|null|undefined} constraint + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @instance + */ + AnalyzeOrgPolicyGovernedAssetsResponse.prototype.constraint = null; + + /** + * AnalyzeOrgPolicyGovernedAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @instance + */ + AnalyzeOrgPolicyGovernedAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new AnalyzeOrgPolicyGovernedAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse} AnalyzeOrgPolicyGovernedAssetsResponse instance + */ + AnalyzeOrgPolicyGovernedAssetsResponse.create = function create(properties) { + return new AnalyzeOrgPolicyGovernedAssetsResponse(properties); + }; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse} message AnalyzeOrgPolicyGovernedAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPolicyGovernedAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.governedAssets != null && message.governedAssets.length) + for (var i = 0; i < message.governedAssets.length; ++i) + $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.encode(message.governedAssets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.encode(message.constraint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified AnalyzeOrgPolicyGovernedAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse} message AnalyzeOrgPolicyGovernedAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeOrgPolicyGovernedAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeOrgPolicyGovernedAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse} AnalyzeOrgPolicyGovernedAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPolicyGovernedAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.governedAssets && message.governedAssets.length)) + message.governedAssets = []; + message.governedAssets.push($root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.decode(reader, reader.uint32())); + break; + } + case 2: { + message.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.decode(reader, reader.uint32()); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeOrgPolicyGovernedAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse} AnalyzeOrgPolicyGovernedAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeOrgPolicyGovernedAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeOrgPolicyGovernedAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeOrgPolicyGovernedAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.governedAssets != null && message.hasOwnProperty("governedAssets")) { + if (!Array.isArray(message.governedAssets)) + return "governedAssets: array expected"; + for (var i = 0; i < message.governedAssets.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.verify(message.governedAssets[i]); + if (error) + return "governedAssets." + error; + } + } + if (message.constraint != null && message.hasOwnProperty("constraint")) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.verify(message.constraint); + if (error) + return "constraint." + error; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates an AnalyzeOrgPolicyGovernedAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse} AnalyzeOrgPolicyGovernedAssetsResponse + */ + AnalyzeOrgPolicyGovernedAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse(); + if (object.governedAssets) { + if (!Array.isArray(object.governedAssets)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governedAssets: array expected"); + message.governedAssets = []; + for (var i = 0; i < object.governedAssets.length; ++i) { + if (typeof object.governedAssets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governedAssets: object expected"); + message.governedAssets[i] = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.fromObject(object.governedAssets[i]); + } + } + if (object.constraint != null) { + if (typeof object.constraint !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.constraint: object expected"); + message.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.fromObject(object.constraint); + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from an AnalyzeOrgPolicyGovernedAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse} message AnalyzeOrgPolicyGovernedAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeOrgPolicyGovernedAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.governedAssets = []; + if (options.defaults) { + object.constraint = null; + object.nextPageToken = ""; + } + if (message.governedAssets && message.governedAssets.length) { + object.governedAssets = []; + for (var j = 0; j < message.governedAssets.length; ++j) + object.governedAssets[j] = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.toObject(message.governedAssets[j], options); + } + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = $root.google.cloud.asset.v1.AnalyzerOrgPolicyConstraint.toObject(message.constraint, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this AnalyzeOrgPolicyGovernedAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeOrgPolicyGovernedAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AnalyzeOrgPolicyGovernedAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AnalyzeOrgPolicyGovernedAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse"; + }; + + AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource = (function() { + + /** + * Properties of a GovernedResource. + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @interface IGovernedResource + * @property {string|null} [fullResourceName] GovernedResource fullResourceName + * @property {string|null} [parent] GovernedResource parent + * @property {string|null} [project] GovernedResource project + * @property {Array.|null} [folders] GovernedResource folders + * @property {string|null} [organization] GovernedResource organization + * @property {string|null} [assetType] GovernedResource assetType + * @property {Array.|null} [effectiveTags] GovernedResource effectiveTags + */ + + /** + * Constructs a new GovernedResource. + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @classdesc Represents a GovernedResource. + * @implements IGovernedResource + * @constructor + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource=} [properties] Properties to set + */ + function GovernedResource(properties) { + this.folders = []; + this.effectiveTags = []; + 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]]; + } + + /** + * GovernedResource fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @instance + */ + GovernedResource.prototype.fullResourceName = ""; + + /** + * GovernedResource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @instance + */ + GovernedResource.prototype.parent = ""; + + /** + * GovernedResource project. + * @member {string} project + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @instance + */ + GovernedResource.prototype.project = ""; + + /** + * GovernedResource folders. + * @member {Array.} folders + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @instance + */ + GovernedResource.prototype.folders = $util.emptyArray; + + /** + * GovernedResource organization. + * @member {string} organization + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @instance + */ + GovernedResource.prototype.organization = ""; + + /** + * GovernedResource assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @instance + */ + GovernedResource.prototype.assetType = ""; + + /** + * GovernedResource effectiveTags. + * @member {Array.} effectiveTags + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @instance + */ + GovernedResource.prototype.effectiveTags = $util.emptyArray; + + /** + * Creates a new GovernedResource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource} GovernedResource instance + */ + GovernedResource.create = function create(properties) { + return new GovernedResource(properties); + }; + + /** + * Encodes the specified GovernedResource message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource} message GovernedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.project); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.folders[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.organization); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.assetType); + if (message.effectiveTags != null && message.effectiveTags.length) + for (var i = 0; i < message.effectiveTags.length; ++i) + $root.google.cloud.asset.v1.EffectiveTagDetails.encode(message.effectiveTags[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GovernedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource} message GovernedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GovernedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource} GovernedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernedResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fullResourceName = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 5: { + message.project = reader.string(); + break; + } + case 6: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + case 7: { + message.organization = reader.string(); + break; + } + case 8: { + message.assetType = reader.string(); + break; + } + case 9: { + if (!(message.effectiveTags && message.effectiveTags.length)) + message.effectiveTags = []; + message.effectiveTags.push($root.google.cloud.asset.v1.EffectiveTagDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GovernedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource} GovernedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GovernedResource message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GovernedResource.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.effectiveTags != null && message.hasOwnProperty("effectiveTags")) { + if (!Array.isArray(message.effectiveTags)) + return "effectiveTags: array expected"; + for (var i = 0; i < message.effectiveTags.length; ++i) { + var error = $root.google.cloud.asset.v1.EffectiveTagDetails.verify(message.effectiveTags[i]); + if (error) + return "effectiveTags." + error; + } + } + return null; + }; + + /** + * Creates a GovernedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource} GovernedResource + */ + GovernedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource(); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + if (object.parent != null) + message.parent = String(object.parent); + if (object.project != null) + message.project = String(object.project); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.effectiveTags) { + if (!Array.isArray(object.effectiveTags)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.effectiveTags: array expected"); + message.effectiveTags = []; + for (var i = 0; i < object.effectiveTags.length; ++i) { + if (typeof object.effectiveTags[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.effectiveTags: object expected"); + message.effectiveTags[i] = $root.google.cloud.asset.v1.EffectiveTagDetails.fromObject(object.effectiveTags[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GovernedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource} message GovernedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GovernedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.folders = []; + object.effectiveTags = []; + } + if (options.defaults) { + object.fullResourceName = ""; + object.parent = ""; + object.project = ""; + object.organization = ""; + object.assetType = ""; + } + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.effectiveTags && message.effectiveTags.length) { + object.effectiveTags = []; + for (var j = 0; j < message.effectiveTags.length; ++j) + object.effectiveTags[j] = $root.google.cloud.asset.v1.EffectiveTagDetails.toObject(message.effectiveTags[j], options); + } + return object; + }; + + /** + * Converts this GovernedResource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @instance + * @returns {Object.} JSON object + */ + GovernedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GovernedResource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GovernedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource"; + }; + + return GovernedResource; + })(); + + AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy = (function() { + + /** + * Properties of a GovernedIamPolicy. + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @interface IGovernedIamPolicy + * @property {string|null} [attachedResource] GovernedIamPolicy attachedResource + * @property {google.iam.v1.IPolicy|null} [policy] GovernedIamPolicy policy + * @property {string|null} [project] GovernedIamPolicy project + * @property {Array.|null} [folders] GovernedIamPolicy folders + * @property {string|null} [organization] GovernedIamPolicy organization + * @property {string|null} [assetType] GovernedIamPolicy assetType + */ + + /** + * Constructs a new GovernedIamPolicy. + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @classdesc Represents a GovernedIamPolicy. + * @implements IGovernedIamPolicy + * @constructor + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy=} [properties] Properties to set + */ + function GovernedIamPolicy(properties) { + this.folders = []; + 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]]; + } + + /** + * GovernedIamPolicy attachedResource. + * @member {string} attachedResource + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @instance + */ + GovernedIamPolicy.prototype.attachedResource = ""; + + /** + * GovernedIamPolicy policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @instance + */ + GovernedIamPolicy.prototype.policy = null; + + /** + * GovernedIamPolicy project. + * @member {string} project + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @instance + */ + GovernedIamPolicy.prototype.project = ""; + + /** + * GovernedIamPolicy folders. + * @member {Array.} folders + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @instance + */ + GovernedIamPolicy.prototype.folders = $util.emptyArray; + + /** + * GovernedIamPolicy organization. + * @member {string} organization + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @instance + */ + GovernedIamPolicy.prototype.organization = ""; + + /** + * GovernedIamPolicy assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @instance + */ + GovernedIamPolicy.prototype.assetType = ""; + + /** + * Creates a new GovernedIamPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy} GovernedIamPolicy instance + */ + GovernedIamPolicy.create = function create(properties) { + return new GovernedIamPolicy(properties); + }; + + /** + * Encodes the specified GovernedIamPolicy message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy} message GovernedIamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernedIamPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResource != null && Object.hasOwnProperty.call(message, "attachedResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResource); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.project); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.folders[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.organization); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.assetType); + return writer; + }; + + /** + * Encodes the specified GovernedIamPolicy message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy} message GovernedIamPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernedIamPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GovernedIamPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy} GovernedIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernedIamPolicy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attachedResource = reader.string(); + break; + } + case 2: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 5: { + message.project = reader.string(); + break; + } + case 6: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + case 7: { + message.organization = reader.string(); + break; + } + case 8: { + message.assetType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GovernedIamPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy} GovernedIamPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernedIamPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GovernedIamPolicy message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GovernedIamPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + if (!$util.isString(message.attachedResource)) + return "attachedResource: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + return null; + }; + + /** + * Creates a GovernedIamPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy} GovernedIamPolicy + */ + GovernedIamPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy(); + if (object.attachedResource != null) + message.attachedResource = String(object.attachedResource); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.project != null) + message.project = String(object.project); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + if (object.assetType != null) + message.assetType = String(object.assetType); + return message; + }; + + /** + * Creates a plain object from a GovernedIamPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy} message GovernedIamPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GovernedIamPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.attachedResource = ""; + object.policy = null; + object.project = ""; + object.organization = ""; + object.assetType = ""; + } + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) + object.attachedResource = message.attachedResource; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + return object; + }; + + /** + * Converts this GovernedIamPolicy to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @instance + * @returns {Object.} JSON object + */ + GovernedIamPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GovernedIamPolicy + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GovernedIamPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy"; + }; + + return GovernedIamPolicy; + })(); + + AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset = (function() { + + /** + * Properties of a GovernedAsset. + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @interface IGovernedAsset + * @property {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource|null} [governedResource] GovernedAsset governedResource + * @property {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy|null} [governedIamPolicy] GovernedAsset governedIamPolicy + * @property {google.cloud.asset.v1.IAnalyzerOrgPolicy|null} [consolidatedPolicy] GovernedAsset consolidatedPolicy + * @property {Array.|null} [policyBundle] GovernedAsset policyBundle + */ + + /** + * Constructs a new GovernedAsset. + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse + * @classdesc Represents a GovernedAsset. + * @implements IGovernedAsset + * @constructor + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset=} [properties] Properties to set + */ + function GovernedAsset(properties) { + this.policyBundle = []; + 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]]; + } + + /** + * GovernedAsset governedResource. + * @member {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedResource|null|undefined} governedResource + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @instance + */ + GovernedAsset.prototype.governedResource = null; + + /** + * GovernedAsset governedIamPolicy. + * @member {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedIamPolicy|null|undefined} governedIamPolicy + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @instance + */ + GovernedAsset.prototype.governedIamPolicy = null; + + /** + * GovernedAsset consolidatedPolicy. + * @member {google.cloud.asset.v1.IAnalyzerOrgPolicy|null|undefined} consolidatedPolicy + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @instance + */ + GovernedAsset.prototype.consolidatedPolicy = null; + + /** + * GovernedAsset policyBundle. + * @member {Array.} policyBundle + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @instance + */ + GovernedAsset.prototype.policyBundle = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GovernedAsset governedAsset. + * @member {"governedResource"|"governedIamPolicy"|undefined} governedAsset + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @instance + */ + Object.defineProperty(GovernedAsset.prototype, "governedAsset", { + get: $util.oneOfGetter($oneOfFields = ["governedResource", "governedIamPolicy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GovernedAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset} GovernedAsset instance + */ + GovernedAsset.create = function create(properties) { + return new GovernedAsset(properties); + }; + + /** + * Encodes the specified GovernedAsset message. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset} message GovernedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernedAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.governedResource != null && Object.hasOwnProperty.call(message, "governedResource")) + $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.encode(message.governedResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.governedIamPolicy != null && Object.hasOwnProperty.call(message, "governedIamPolicy")) + $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.encode(message.governedIamPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.consolidatedPolicy != null && Object.hasOwnProperty.call(message, "consolidatedPolicy")) + $root.google.cloud.asset.v1.AnalyzerOrgPolicy.encode(message.consolidatedPolicy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.policyBundle != null && message.policyBundle.length) + for (var i = 0; i < message.policyBundle.length; ++i) + $root.google.cloud.asset.v1.AnalyzerOrgPolicy.encode(message.policyBundle[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GovernedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset} message GovernedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GovernedAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GovernedAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset} GovernedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernedAsset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.governedResource = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.governedIamPolicy = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + message.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.policyBundle && message.policyBundle.length)) + message.policyBundle = []; + message.policyBundle.push($root.google.cloud.asset.v1.AnalyzerOrgPolicy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GovernedAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset} GovernedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GovernedAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GovernedAsset message. + * @function verify + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GovernedAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.governedResource != null && message.hasOwnProperty("governedResource")) { + properties.governedAsset = 1; + { + var error = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.verify(message.governedResource); + if (error) + return "governedResource." + error; + } + } + if (message.governedIamPolicy != null && message.hasOwnProperty("governedIamPolicy")) { + if (properties.governedAsset === 1) + return "governedAsset: multiple values"; + properties.governedAsset = 1; + { + var error = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.verify(message.governedIamPolicy); + if (error) + return "governedIamPolicy." + error; + } + } + if (message.consolidatedPolicy != null && message.hasOwnProperty("consolidatedPolicy")) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.verify(message.consolidatedPolicy); + if (error) + return "consolidatedPolicy." + error; + } + if (message.policyBundle != null && message.hasOwnProperty("policyBundle")) { + if (!Array.isArray(message.policyBundle)) + return "policyBundle: array expected"; + for (var i = 0; i < message.policyBundle.length; ++i) { + var error = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.verify(message.policyBundle[i]); + if (error) + return "policyBundle." + error; + } + } + return null; + }; + + /** + * Creates a GovernedAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset} GovernedAsset + */ + GovernedAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset) + return object; + var message = new $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset(); + if (object.governedResource != null) { + if (typeof object.governedResource !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governedResource: object expected"); + message.governedResource = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.fromObject(object.governedResource); + } + if (object.governedIamPolicy != null) { + if (typeof object.governedIamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.governedIamPolicy: object expected"); + message.governedIamPolicy = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.fromObject(object.governedIamPolicy); + } + if (object.consolidatedPolicy != null) { + if (typeof object.consolidatedPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.consolidatedPolicy: object expected"); + message.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.fromObject(object.consolidatedPolicy); + } + if (object.policyBundle) { + if (!Array.isArray(object.policyBundle)) + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policyBundle: array expected"); + message.policyBundle = []; + for (var i = 0; i < object.policyBundle.length; ++i) { + if (typeof object.policyBundle[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset.policyBundle: object expected"); + message.policyBundle[i] = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.fromObject(object.policyBundle[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GovernedAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset} message GovernedAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GovernedAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.policyBundle = []; + if (options.defaults) + object.consolidatedPolicy = null; + if (message.governedResource != null && message.hasOwnProperty("governedResource")) { + object.governedResource = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedResource.toObject(message.governedResource, options); + if (options.oneofs) + object.governedAsset = "governedResource"; + } + if (message.governedIamPolicy != null && message.hasOwnProperty("governedIamPolicy")) { + object.governedIamPolicy = $root.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedIamPolicy.toObject(message.governedIamPolicy, options); + if (options.oneofs) + object.governedAsset = "governedIamPolicy"; + } + if (message.consolidatedPolicy != null && message.hasOwnProperty("consolidatedPolicy")) + object.consolidatedPolicy = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.toObject(message.consolidatedPolicy, options); + if (message.policyBundle && message.policyBundle.length) { + object.policyBundle = []; + for (var j = 0; j < message.policyBundle.length; ++j) + object.policyBundle[j] = $root.google.cloud.asset.v1.AnalyzerOrgPolicy.toObject(message.policyBundle[j], options); + } + return object; + }; + + /** + * Converts this GovernedAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @instance + * @returns {Object.} JSON object + */ + GovernedAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GovernedAsset + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GovernedAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset"; + }; + + return GovernedAsset; + })(); + + return AnalyzeOrgPolicyGovernedAssetsResponse; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + * @property {number} OS_INVENTORY=6 OS_INVENTORY value + * @property {number} RELATIONSHIP=7 RELATIONSHIP value + */ + v1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + values[valuesById[6] = "OS_INVENTORY"] = 6; + values[valuesById[7] = "RELATIONSHIP"] = 7; + return values; + })(); + + v1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1.IAsset|null} [asset] TemporalAsset asset + * @property {google.cloud.asset.v1.TemporalAsset.PriorAssetState|null} [priorAssetState] TemporalAsset priorAssetState + * @property {google.cloud.asset.v1.IAsset|null} [priorAsset] TemporalAsset priorAsset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * TemporalAsset priorAssetState. + * @member {google.cloud.asset.v1.TemporalAsset.PriorAssetState} priorAssetState + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.priorAssetState = 0; + + /** + * TemporalAsset priorAsset. + * @member {google.cloud.asset.v1.IAsset|null|undefined} priorAsset + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.priorAsset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && Object.hasOwnProperty.call(message, "window")) + $root.google.cloud.asset.v1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.asset.v1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.priorAssetState != null && Object.hasOwnProperty.call(message, "priorAssetState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.priorAssetState); + if (message.priorAsset != null && Object.hasOwnProperty.call(message, "priorAsset")) + $root.google.cloud.asset.v1.Asset.encode(message.priorAsset, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.window = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deleted = reader.bool(); + break; + } + case 3: { + message.asset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + } + case 4: { + message.priorAssetState = reader.int32(); + break; + } + case 5: { + message.priorAsset = $root.google.cloud.asset.v1.Asset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + switch (message.priorAssetState) { + default: + return "priorAssetState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) { + var error = $root.google.cloud.asset.v1.Asset.verify(message.priorAsset); + if (error) + return "priorAsset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1.Asset.fromObject(object.asset); + } + switch (object.priorAssetState) { + default: + if (typeof object.priorAssetState === "number") { + message.priorAssetState = object.priorAssetState; + break; + } + break; + case "PRIOR_ASSET_STATE_UNSPECIFIED": + case 0: + message.priorAssetState = 0; + break; + case "PRESENT": + case 1: + message.priorAssetState = 1; + break; + case "INVALID": + case 2: + message.priorAssetState = 2; + break; + case "DOES_NOT_EXIST": + case 3: + message.priorAssetState = 3; + break; + case "DELETED": + case 4: + message.priorAssetState = 4; + break; + } + if (object.priorAsset != null) { + if (typeof object.priorAsset !== "object") + throw TypeError(".google.cloud.asset.v1.TemporalAsset.priorAsset: object expected"); + message.priorAsset = $root.google.cloud.asset.v1.Asset.fromObject(object.priorAsset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {google.cloud.asset.v1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + object.priorAssetState = options.enums === String ? "PRIOR_ASSET_STATE_UNSPECIFIED" : 0; + object.priorAsset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1.Asset.toObject(message.asset, options); + if (message.priorAssetState != null && message.hasOwnProperty("priorAssetState")) + object.priorAssetState = options.enums === String ? $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] === undefined ? message.priorAssetState : $root.google.cloud.asset.v1.TemporalAsset.PriorAssetState[message.priorAssetState] : message.priorAssetState; + if (message.priorAsset != null && message.hasOwnProperty("priorAsset")) + object.priorAsset = $root.google.cloud.asset.v1.Asset.toObject(message.priorAsset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TemporalAsset + * @function getTypeUrl + * @memberof google.cloud.asset.v1.TemporalAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TemporalAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.TemporalAsset"; + }; + + /** + * PriorAssetState enum. + * @name google.cloud.asset.v1.TemporalAsset.PriorAssetState + * @enum {number} + * @property {number} PRIOR_ASSET_STATE_UNSPECIFIED=0 PRIOR_ASSET_STATE_UNSPECIFIED value + * @property {number} PRESENT=1 PRESENT value + * @property {number} INVALID=2 INVALID value + * @property {number} DOES_NOT_EXIST=3 DOES_NOT_EXIST value + * @property {number} DELETED=4 DELETED value + */ + TemporalAsset.PriorAssetState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIOR_ASSET_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESENT"] = 1; + values[valuesById[2] = "INVALID"] = 2; + values[valuesById[3] = "DOES_NOT_EXIST"] = 3; + values[valuesById[4] = "DELETED"] = 4; + return values; + })(); + + return TemporalAsset; + })(); + + v1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.v1 + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + */ + + /** + * Constructs a new TimeWindow. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + */ + function TimeWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.TimeWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeWindow message. + * @function verify + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1.TimeWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.asset.v1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {google.cloud.asset.v1.TimeWindow} message TimeWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimeWindow to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeWindow + * @function getTypeUrl + * @memberof google.cloud.asset.v1.TimeWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.TimeWindow"; + }; + + return TimeWindow; + })(); + + v1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1 + * @interface IAsset + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {google.cloud.osconfig.v1.IInventory|null} [osInventory] Asset osInventory + * @property {google.cloud.asset.v1.IRelatedAssets|null} [relatedAssets] Asset relatedAssets + * @property {google.cloud.asset.v1.IRelatedAsset|null} [relatedAsset] Asset relatedAsset + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.orgPolicy = []; + this.ancestors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + + /** + * Asset osInventory. + * @member {google.cloud.osconfig.v1.IInventory|null|undefined} osInventory + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.osInventory = null; + + /** + * Asset relatedAssets. + * @member {google.cloud.asset.v1.IRelatedAssets|null|undefined} relatedAssets + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.relatedAssets = null; + + /** + * Asset relatedAsset. + * @member {google.cloud.asset.v1.IRelatedAsset|null|undefined} relatedAsset + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.relatedAsset = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.osInventory != null && Object.hasOwnProperty.call(message, "osInventory")) + $root.google.cloud.osconfig.v1.Inventory.encode(message.osInventory, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.relatedAssets != null && Object.hasOwnProperty.call(message, "relatedAssets")) + $root.google.cloud.asset.v1.RelatedAssets.encode(message.relatedAssets, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.relatedAsset != null && Object.hasOwnProperty.call(message, "relatedAsset")) + $root.google.cloud.asset.v1.RelatedAsset.encode(message.relatedAsset, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.asset.v1.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + } + case 7: { + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + } + case 9: { + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + } + case 12: { + message.osInventory = $root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32()); + break; + } + case 13: { + message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.decode(reader, reader.uint32()); + break; + } + case 15: { + message.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.osInventory != null && message.hasOwnProperty("osInventory")) { + var error = $root.google.cloud.osconfig.v1.Inventory.verify(message.osInventory); + if (error) + return "osInventory." + error; + } + if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) { + var error = $root.google.cloud.asset.v1.RelatedAssets.verify(message.relatedAssets); + if (error) + return "relatedAssets." + error; + } + if (message.relatedAsset != null && message.hasOwnProperty("relatedAsset")) { + var error = $root.google.cloud.asset.v1.RelatedAsset.verify(message.relatedAsset); + if (error) + return "relatedAsset." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Asset) + return object; + var message = new $root.google.cloud.asset.v1.Asset(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } + if (object.osInventory != null) { + if (typeof object.osInventory !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.osInventory: object expected"); + message.osInventory = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.osInventory); + } + if (object.relatedAssets != null) { + if (typeof object.relatedAssets !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.relatedAssets: object expected"); + message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.fromObject(object.relatedAssets); + } + if (object.relatedAsset != null) { + if (typeof object.relatedAsset !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.relatedAsset: object expected"); + message.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.fromObject(object.relatedAsset); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {google.cloud.asset.v1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.orgPolicy = []; + object.ancestors = []; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + object.updateTime = null; + object.osInventory = null; + object.relatedAssets = null; + object.relatedAsset = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.osInventory != null && message.hasOwnProperty("osInventory")) + object.osInventory = $root.google.cloud.osconfig.v1.Inventory.toObject(message.osInventory, options); + if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) + object.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.toObject(message.relatedAssets, options); + if (message.relatedAsset != null && message.hasOwnProperty("relatedAsset")) + object.relatedAsset = $root.google.cloud.asset.v1.RelatedAsset.toObject(message.relatedAsset, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.asset.v1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.Asset"; + }; + + return Asset; + })(); + + v1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + * @property {string|null} [location] Resource location + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.asset.v1.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Resource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.discoveryDocumentUri = reader.string(); + break; + } + case 3: { + message.discoveryName = reader.string(); + break; + } + case 4: { + message.resourceUrl = reader.string(); + break; + } + case 5: { + message.parent = reader.string(); + break; + } + case 6: { + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 8: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Resource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Resource message. + * @function verify + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Resource) + return object; + var message = new $root.google.cloud.asset.v1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {google.cloud.asset.v1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + object.location = ""; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.Resource"; + }; + + return Resource; + })(); + + v1.RelatedAssets = (function() { + + /** + * Properties of a RelatedAssets. + * @memberof google.cloud.asset.v1 + * @interface IRelatedAssets + * @property {google.cloud.asset.v1.IRelationshipAttributes|null} [relationshipAttributes] RelatedAssets relationshipAttributes + * @property {Array.|null} [assets] RelatedAssets assets + */ + + /** + * Constructs a new RelatedAssets. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedAssets. + * @implements IRelatedAssets + * @constructor + * @param {google.cloud.asset.v1.IRelatedAssets=} [properties] Properties to set + */ + function RelatedAssets(properties) { + this.assets = []; + 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]]; + } + + /** + * RelatedAssets relationshipAttributes. + * @member {google.cloud.asset.v1.IRelationshipAttributes|null|undefined} relationshipAttributes + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + */ + RelatedAssets.prototype.relationshipAttributes = null; + + /** + * RelatedAssets assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + */ + RelatedAssets.prototype.assets = $util.emptyArray; + + /** + * Creates a new RelatedAssets instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets instance + */ + RelatedAssets.create = function create(properties) { + return new RelatedAssets(properties); + }; + + /** + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets} message RelatedAssets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAssets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relationshipAttributes != null && Object.hasOwnProperty.call(message, "relationshipAttributes")) + $root.google.cloud.asset.v1.RelationshipAttributes.encode(message.relationshipAttributes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1.RelatedAsset.encode(message.assets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets} message RelatedAssets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAssets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAssets.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.RelatedAssets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAssets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAssets message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAssets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relationshipAttributes != null && message.hasOwnProperty("relationshipAttributes")) { + var error = $root.google.cloud.asset.v1.RelationshipAttributes.verify(message.relationshipAttributes); + if (error) + return "relationshipAttributes." + error; + } + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1.RelatedAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + */ + RelatedAssets.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedAssets) + return object; + var message = new $root.google.cloud.asset.v1.RelatedAssets(); + if (object.relationshipAttributes != null) { + if (typeof object.relationshipAttributes !== "object") + throw TypeError(".google.cloud.asset.v1.RelatedAssets.relationshipAttributes: object expected"); + message.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.fromObject(object.relationshipAttributes); + } + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1.RelatedAssets.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.RelatedAssets.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1.RelatedAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.RelatedAssets} message RelatedAssets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAssets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) + object.relationshipAttributes = null; + if (message.relationshipAttributes != null && message.hasOwnProperty("relationshipAttributes")) + object.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.toObject(message.relationshipAttributes, options); + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1.RelatedAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this RelatedAssets to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + * @returns {Object.} JSON object + */ + RelatedAssets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelatedAssets + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedAssets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelatedAssets"; + }; + + return RelatedAssets; + })(); + + v1.RelationshipAttributes = (function() { + + /** + * Properties of a RelationshipAttributes. + * @memberof google.cloud.asset.v1 + * @interface IRelationshipAttributes + * @property {string|null} [type] RelationshipAttributes type + * @property {string|null} [sourceResourceType] RelationshipAttributes sourceResourceType + * @property {string|null} [targetResourceType] RelationshipAttributes targetResourceType + * @property {string|null} [action] RelationshipAttributes action + */ + + /** + * Constructs a new RelationshipAttributes. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelationshipAttributes. + * @implements IRelationshipAttributes + * @constructor + * @param {google.cloud.asset.v1.IRelationshipAttributes=} [properties] Properties to set + */ + function RelationshipAttributes(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]]; + } + + /** + * RelationshipAttributes type. + * @member {string} type + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.type = ""; + + /** + * RelationshipAttributes sourceResourceType. + * @member {string} sourceResourceType + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.sourceResourceType = ""; + + /** + * RelationshipAttributes targetResourceType. + * @member {string} targetResourceType + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.targetResourceType = ""; + + /** + * RelationshipAttributes action. + * @member {string} action + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.action = ""; + + /** + * Creates a new RelationshipAttributes instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes instance + */ + RelationshipAttributes.create = function create(properties) { + return new RelationshipAttributes(properties); + }; + + /** + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes} message RelationshipAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelationshipAttributes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceResourceType != null && Object.hasOwnProperty.call(message, "sourceResourceType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceResourceType); + if (message.targetResourceType != null && Object.hasOwnProperty.call(message, "targetResourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetResourceType); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + return writer; + }; + + /** + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes} message RelationshipAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelationshipAttributes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelationshipAttributes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.RelationshipAttributes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.type = reader.string(); + break; + } + case 1: { + message.sourceResourceType = reader.string(); + break; + } + case 2: { + message.targetResourceType = reader.string(); + break; + } + case 3: { + message.action = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelationshipAttributes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelationshipAttributes message. + * @function verify + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelationshipAttributes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.sourceResourceType != null && message.hasOwnProperty("sourceResourceType")) + if (!$util.isString(message.sourceResourceType)) + return "sourceResourceType: string expected"; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + if (!$util.isString(message.targetResourceType)) + return "targetResourceType: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + return null; + }; + + /** + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + */ + RelationshipAttributes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelationshipAttributes) + return object; + var message = new $root.google.cloud.asset.v1.RelationshipAttributes(); + if (object.type != null) + message.type = String(object.type); + if (object.sourceResourceType != null) + message.sourceResourceType = String(object.sourceResourceType); + if (object.targetResourceType != null) + message.targetResourceType = String(object.targetResourceType); + if (object.action != null) + message.action = String(object.action); + return message; + }; + + /** + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.RelationshipAttributes} message RelationshipAttributes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelationshipAttributes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceResourceType = ""; + object.targetResourceType = ""; + object.action = ""; + object.type = ""; + } + if (message.sourceResourceType != null && message.hasOwnProperty("sourceResourceType")) + object.sourceResourceType = message.sourceResourceType; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + object.targetResourceType = message.targetResourceType; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this RelationshipAttributes to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + * @returns {Object.} JSON object + */ + RelationshipAttributes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelationshipAttributes + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelationshipAttributes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelationshipAttributes"; + }; + + return RelationshipAttributes; + })(); + + v1.RelatedAsset = (function() { + + /** + * Properties of a RelatedAsset. + * @memberof google.cloud.asset.v1 + * @interface IRelatedAsset + * @property {string|null} [asset] RelatedAsset asset + * @property {string|null} [assetType] RelatedAsset assetType + * @property {Array.|null} [ancestors] RelatedAsset ancestors + * @property {string|null} [relationshipType] RelatedAsset relationshipType + */ + + /** + * Constructs a new RelatedAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedAsset. + * @implements IRelatedAsset + * @constructor + * @param {google.cloud.asset.v1.IRelatedAsset=} [properties] Properties to set + */ + function RelatedAsset(properties) { + this.ancestors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelatedAsset asset. + * @member {string} asset + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.asset = ""; + + /** + * RelatedAsset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.assetType = ""; + + /** + * RelatedAsset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.ancestors = $util.emptyArray; + + /** + * RelatedAsset relationshipType. + * @member {string} relationshipType + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.relationshipType = ""; + + /** + * Creates a new RelatedAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset instance + */ + RelatedAsset.create = function create(properties) { + return new RelatedAsset(properties); + }; + + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset} message RelatedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.asset); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestors[i]); + if (message.relationshipType != null && Object.hasOwnProperty.call(message, "relationshipType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.relationshipType); + return writer; + }; + + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset} message RelatedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAsset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.RelatedAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.asset = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } + case 4: { + message.relationshipType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAsset message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + if (message.relationshipType != null && message.hasOwnProperty("relationshipType")) + if (!$util.isString(message.relationshipType)) + return "relationshipType: string expected"; + return null; + }; + + /** + * Creates a RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + */ + RelatedAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedAsset) + return object; + var message = new $root.google.cloud.asset.v1.RelatedAsset(); + if (object.asset != null) + message.asset = String(object.asset); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.RelatedAsset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + if (object.relationshipType != null) + message.relationshipType = String(object.relationshipType); + return message; + }; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.RelatedAsset} message RelatedAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.asset = ""; + object.assetType = ""; + object.relationshipType = ""; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + if (message.relationshipType != null && message.hasOwnProperty("relationshipType")) + object.relationshipType = message.relationshipType; + return object; + }; + + /** + * Converts this RelatedAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + * @returns {Object.} JSON object + */ + RelatedAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelatedAsset + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelatedAsset"; + }; + + return RelatedAsset; + })(); + + v1.Tag = (function() { + + /** + * Properties of a Tag. + * @memberof google.cloud.asset.v1 + * @interface ITag + * @property {string|null} [tagKey] Tag tagKey + * @property {string|null} [tagKeyId] Tag tagKeyId + * @property {string|null} [tagValue] Tag tagValue + * @property {string|null} [tagValueId] Tag tagValueId + */ + + /** + * Constructs a new Tag. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a Tag. + * @implements ITag + * @constructor + * @param {google.cloud.asset.v1.ITag=} [properties] Properties to set + */ + function Tag(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]]; + } + + /** + * Tag tagKey. + * @member {string|null|undefined} tagKey + * @memberof google.cloud.asset.v1.Tag + * @instance + */ + Tag.prototype.tagKey = null; + + /** + * Tag tagKeyId. + * @member {string|null|undefined} tagKeyId + * @memberof google.cloud.asset.v1.Tag + * @instance + */ + Tag.prototype.tagKeyId = null; + + /** + * Tag tagValue. + * @member {string|null|undefined} tagValue + * @memberof google.cloud.asset.v1.Tag + * @instance + */ + Tag.prototype.tagValue = null; + + /** + * Tag tagValueId. + * @member {string|null|undefined} tagValueId + * @memberof google.cloud.asset.v1.Tag + * @instance + */ + Tag.prototype.tagValueId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Tag _tagKey. + * @member {"tagKey"|undefined} _tagKey + * @memberof google.cloud.asset.v1.Tag + * @instance + */ + Object.defineProperty(Tag.prototype, "_tagKey", { + get: $util.oneOfGetter($oneOfFields = ["tagKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Tag _tagKeyId. + * @member {"tagKeyId"|undefined} _tagKeyId + * @memberof google.cloud.asset.v1.Tag + * @instance + */ + Object.defineProperty(Tag.prototype, "_tagKeyId", { + get: $util.oneOfGetter($oneOfFields = ["tagKeyId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Tag _tagValue. + * @member {"tagValue"|undefined} _tagValue + * @memberof google.cloud.asset.v1.Tag + * @instance + */ + Object.defineProperty(Tag.prototype, "_tagValue", { + get: $util.oneOfGetter($oneOfFields = ["tagValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Tag _tagValueId. + * @member {"tagValueId"|undefined} _tagValueId + * @memberof google.cloud.asset.v1.Tag + * @instance + */ + Object.defineProperty(Tag.prototype, "_tagValueId", { + get: $util.oneOfGetter($oneOfFields = ["tagValueId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Tag instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {google.cloud.asset.v1.ITag=} [properties] Properties to set + * @returns {google.cloud.asset.v1.Tag} Tag instance + */ + Tag.create = function create(properties) { + return new Tag(properties); + }; + + /** + * Encodes the specified Tag message. Does not implicitly {@link google.cloud.asset.v1.Tag.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {google.cloud.asset.v1.ITag} message Tag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tag.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tagKey != null && Object.hasOwnProperty.call(message, "tagKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tagKey); + if (message.tagKeyId != null && Object.hasOwnProperty.call(message, "tagKeyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.tagKeyId); + if (message.tagValue != null && Object.hasOwnProperty.call(message, "tagValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tagValue); + if (message.tagValueId != null && Object.hasOwnProperty.call(message, "tagValueId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tagValueId); + return writer; + }; + + /** + * Encodes the specified Tag message, length delimited. Does not implicitly {@link google.cloud.asset.v1.Tag.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {google.cloud.asset.v1.ITag} message Tag message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tag.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tag message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.Tag} Tag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tag.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.Tag(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tagKey = reader.string(); + break; + } + case 2: { + message.tagKeyId = reader.string(); + break; + } + case 3: { + message.tagValue = reader.string(); + break; + } + case 4: { + message.tagValueId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tag message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.Tag} Tag + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tag.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tag message. + * @function verify + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tag.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tagKey != null && message.hasOwnProperty("tagKey")) { + properties._tagKey = 1; + if (!$util.isString(message.tagKey)) + return "tagKey: string expected"; + } + if (message.tagKeyId != null && message.hasOwnProperty("tagKeyId")) { + properties._tagKeyId = 1; + if (!$util.isString(message.tagKeyId)) + return "tagKeyId: string expected"; + } + if (message.tagValue != null && message.hasOwnProperty("tagValue")) { + properties._tagValue = 1; + if (!$util.isString(message.tagValue)) + return "tagValue: string expected"; + } + if (message.tagValueId != null && message.hasOwnProperty("tagValueId")) { + properties._tagValueId = 1; + if (!$util.isString(message.tagValueId)) + return "tagValueId: string expected"; + } + return null; + }; + + /** + * Creates a Tag message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.Tag} Tag + */ + Tag.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.Tag) + return object; + var message = new $root.google.cloud.asset.v1.Tag(); + if (object.tagKey != null) + message.tagKey = String(object.tagKey); + if (object.tagKeyId != null) + message.tagKeyId = String(object.tagKeyId); + if (object.tagValue != null) + message.tagValue = String(object.tagValue); + if (object.tagValueId != null) + message.tagValueId = String(object.tagValueId); + return message; + }; + + /** + * Creates a plain object from a Tag message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {google.cloud.asset.v1.Tag} message Tag + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tag.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.tagKey != null && message.hasOwnProperty("tagKey")) { + object.tagKey = message.tagKey; + if (options.oneofs) + object._tagKey = "tagKey"; + } + if (message.tagKeyId != null && message.hasOwnProperty("tagKeyId")) { + object.tagKeyId = message.tagKeyId; + if (options.oneofs) + object._tagKeyId = "tagKeyId"; + } + if (message.tagValue != null && message.hasOwnProperty("tagValue")) { + object.tagValue = message.tagValue; + if (options.oneofs) + object._tagValue = "tagValue"; + } + if (message.tagValueId != null && message.hasOwnProperty("tagValueId")) { + object.tagValueId = message.tagValueId; + if (options.oneofs) + object._tagValueId = "tagValueId"; + } + return object; + }; + + /** + * Converts this Tag to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.Tag + * @instance + * @returns {Object.} JSON object + */ + Tag.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tag + * @function getTypeUrl + * @memberof google.cloud.asset.v1.Tag + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tag.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.Tag"; + }; + + return Tag; + })(); + + v1.EffectiveTagDetails = (function() { + + /** + * Properties of an EffectiveTagDetails. + * @memberof google.cloud.asset.v1 + * @interface IEffectiveTagDetails + * @property {string|null} [attachedResource] EffectiveTagDetails attachedResource + * @property {Array.|null} [effectiveTags] EffectiveTagDetails effectiveTags + */ + + /** + * Constructs a new EffectiveTagDetails. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an EffectiveTagDetails. + * @implements IEffectiveTagDetails + * @constructor + * @param {google.cloud.asset.v1.IEffectiveTagDetails=} [properties] Properties to set + */ + function EffectiveTagDetails(properties) { + this.effectiveTags = []; + 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]]; + } + + /** + * EffectiveTagDetails attachedResource. + * @member {string|null|undefined} attachedResource + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @instance + */ + EffectiveTagDetails.prototype.attachedResource = null; + + /** + * EffectiveTagDetails effectiveTags. + * @member {Array.} effectiveTags + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @instance + */ + EffectiveTagDetails.prototype.effectiveTags = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EffectiveTagDetails _attachedResource. + * @member {"attachedResource"|undefined} _attachedResource + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @instance + */ + Object.defineProperty(EffectiveTagDetails.prototype, "_attachedResource", { + get: $util.oneOfGetter($oneOfFields = ["attachedResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EffectiveTagDetails instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {google.cloud.asset.v1.IEffectiveTagDetails=} [properties] Properties to set + * @returns {google.cloud.asset.v1.EffectiveTagDetails} EffectiveTagDetails instance + */ + EffectiveTagDetails.create = function create(properties) { + return new EffectiveTagDetails(properties); + }; + + /** + * Encodes the specified EffectiveTagDetails message. Does not implicitly {@link google.cloud.asset.v1.EffectiveTagDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {google.cloud.asset.v1.IEffectiveTagDetails} message EffectiveTagDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveTagDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attachedResource != null && Object.hasOwnProperty.call(message, "attachedResource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResource); + if (message.effectiveTags != null && message.effectiveTags.length) + for (var i = 0; i < message.effectiveTags.length; ++i) + $root.google.cloud.asset.v1.Tag.encode(message.effectiveTags[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EffectiveTagDetails message, length delimited. Does not implicitly {@link google.cloud.asset.v1.EffectiveTagDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {google.cloud.asset.v1.IEffectiveTagDetails} message EffectiveTagDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EffectiveTagDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EffectiveTagDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.EffectiveTagDetails} EffectiveTagDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveTagDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.EffectiveTagDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.attachedResource = reader.string(); + break; + } + case 2: { + if (!(message.effectiveTags && message.effectiveTags.length)) + message.effectiveTags = []; + message.effectiveTags.push($root.google.cloud.asset.v1.Tag.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EffectiveTagDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.EffectiveTagDetails} EffectiveTagDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EffectiveTagDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EffectiveTagDetails message. + * @function verify + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EffectiveTagDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) { + properties._attachedResource = 1; + if (!$util.isString(message.attachedResource)) + return "attachedResource: string expected"; + } + if (message.effectiveTags != null && message.hasOwnProperty("effectiveTags")) { + if (!Array.isArray(message.effectiveTags)) + return "effectiveTags: array expected"; + for (var i = 0; i < message.effectiveTags.length; ++i) { + var error = $root.google.cloud.asset.v1.Tag.verify(message.effectiveTags[i]); + if (error) + return "effectiveTags." + error; + } + } + return null; + }; + + /** + * Creates an EffectiveTagDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.EffectiveTagDetails} EffectiveTagDetails + */ + EffectiveTagDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.EffectiveTagDetails) + return object; + var message = new $root.google.cloud.asset.v1.EffectiveTagDetails(); + if (object.attachedResource != null) + message.attachedResource = String(object.attachedResource); + if (object.effectiveTags) { + if (!Array.isArray(object.effectiveTags)) + throw TypeError(".google.cloud.asset.v1.EffectiveTagDetails.effectiveTags: array expected"); + message.effectiveTags = []; + for (var i = 0; i < object.effectiveTags.length; ++i) { + if (typeof object.effectiveTags[i] !== "object") + throw TypeError(".google.cloud.asset.v1.EffectiveTagDetails.effectiveTags: object expected"); + message.effectiveTags[i] = $root.google.cloud.asset.v1.Tag.fromObject(object.effectiveTags[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EffectiveTagDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {google.cloud.asset.v1.EffectiveTagDetails} message EffectiveTagDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EffectiveTagDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.effectiveTags = []; + if (message.attachedResource != null && message.hasOwnProperty("attachedResource")) { + object.attachedResource = message.attachedResource; + if (options.oneofs) + object._attachedResource = "attachedResource"; + } + if (message.effectiveTags && message.effectiveTags.length) { + object.effectiveTags = []; + for (var j = 0; j < message.effectiveTags.length; ++j) + object.effectiveTags[j] = $root.google.cloud.asset.v1.Tag.toObject(message.effectiveTags[j], options); + } + return object; + }; + + /** + * Converts this EffectiveTagDetails to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @instance + * @returns {Object.} JSON object + */ + EffectiveTagDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EffectiveTagDetails + * @function getTypeUrl + * @memberof google.cloud.asset.v1.EffectiveTagDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EffectiveTagDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.EffectiveTagDetails"; + }; + + return EffectiveTagDetails; + })(); + + v1.ResourceSearchResult = (function() { + + /** + * Properties of a ResourceSearchResult. + * @memberof google.cloud.asset.v1 + * @interface IResourceSearchResult + * @property {string|null} [name] ResourceSearchResult name + * @property {string|null} [assetType] ResourceSearchResult assetType + * @property {string|null} [project] ResourceSearchResult project + * @property {Array.|null} [folders] ResourceSearchResult folders + * @property {string|null} [organization] ResourceSearchResult organization + * @property {string|null} [displayName] ResourceSearchResult displayName + * @property {string|null} [description] ResourceSearchResult description + * @property {string|null} [location] ResourceSearchResult location + * @property {Object.|null} [labels] ResourceSearchResult labels + * @property {Array.|null} [networkTags] ResourceSearchResult networkTags + * @property {string|null} [kmsKey] ResourceSearchResult kmsKey + * @property {Array.|null} [kmsKeys] ResourceSearchResult kmsKeys + * @property {google.protobuf.ITimestamp|null} [createTime] ResourceSearchResult createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ResourceSearchResult updateTime + * @property {string|null} [state] ResourceSearchResult state + * @property {google.protobuf.IStruct|null} [additionalAttributes] ResourceSearchResult additionalAttributes + * @property {string|null} [parentFullResourceName] ResourceSearchResult parentFullResourceName + * @property {Array.|null} [versionedResources] ResourceSearchResult versionedResources + * @property {Array.|null} [attachedResources] ResourceSearchResult attachedResources + * @property {Object.|null} [relationships] ResourceSearchResult relationships + * @property {Array.|null} [tagKeys] ResourceSearchResult tagKeys + * @property {Array.|null} [tagValues] ResourceSearchResult tagValues + * @property {Array.|null} [tagValueIds] ResourceSearchResult tagValueIds + * @property {Array.|null} [tags] ResourceSearchResult tags + * @property {Array.|null} [effectiveTags] ResourceSearchResult effectiveTags + * @property {string|null} [parentAssetType] ResourceSearchResult parentAssetType + * @property {Object.|null} [sccSecurityMarks] ResourceSearchResult sccSecurityMarks + */ + + /** + * Constructs a new ResourceSearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ResourceSearchResult. + * @implements IResourceSearchResult + * @constructor + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + */ + function ResourceSearchResult(properties) { + this.folders = []; + this.labels = {}; + this.networkTags = []; + this.kmsKeys = []; + this.versionedResources = []; + this.attachedResources = []; + this.relationships = {}; + this.tagKeys = []; + this.tagValues = []; + this.tagValueIds = []; + this.tags = []; + this.effectiveTags = []; + this.sccSecurityMarks = {}; + 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]]; + } + + /** + * ResourceSearchResult name. + * @member {string} name + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.name = ""; + + /** + * ResourceSearchResult assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.assetType = ""; + + /** + * ResourceSearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.project = ""; + + /** + * ResourceSearchResult folders. + * @member {Array.} folders + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.folders = $util.emptyArray; + + /** + * ResourceSearchResult organization. + * @member {string} organization + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.organization = ""; + + /** + * ResourceSearchResult displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.displayName = ""; + + /** + * ResourceSearchResult description. + * @member {string} description + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.description = ""; + + /** + * ResourceSearchResult location. + * @member {string} location + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.location = ""; + + /** + * ResourceSearchResult labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.labels = $util.emptyObject; + + /** + * ResourceSearchResult networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.networkTags = $util.emptyArray; + + /** + * ResourceSearchResult kmsKey. + * @member {string} kmsKey + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.kmsKey = ""; + + /** + * ResourceSearchResult kmsKeys. + * @member {Array.} kmsKeys + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.kmsKeys = $util.emptyArray; + + /** + * ResourceSearchResult createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.createTime = null; + + /** + * ResourceSearchResult updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.updateTime = null; + + /** + * ResourceSearchResult state. + * @member {string} state + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.state = ""; + + /** + * ResourceSearchResult additionalAttributes. + * @member {google.protobuf.IStruct|null|undefined} additionalAttributes + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.additionalAttributes = null; + + /** + * ResourceSearchResult parentFullResourceName. + * @member {string} parentFullResourceName + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.parentFullResourceName = ""; + + /** + * ResourceSearchResult versionedResources. + * @member {Array.} versionedResources + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.versionedResources = $util.emptyArray; + + /** + * ResourceSearchResult attachedResources. + * @member {Array.} attachedResources + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.attachedResources = $util.emptyArray; + + /** + * ResourceSearchResult relationships. + * @member {Object.} relationships + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.relationships = $util.emptyObject; + + /** + * ResourceSearchResult tagKeys. + * @member {Array.} tagKeys + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagKeys = $util.emptyArray; + + /** + * ResourceSearchResult tagValues. + * @member {Array.} tagValues + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagValues = $util.emptyArray; + + /** + * ResourceSearchResult tagValueIds. + * @member {Array.} tagValueIds + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tagValueIds = $util.emptyArray; + + /** + * ResourceSearchResult tags. + * @member {Array.} tags + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.tags = $util.emptyArray; + + /** + * ResourceSearchResult effectiveTags. + * @member {Array.} effectiveTags + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.effectiveTags = $util.emptyArray; + + /** + * ResourceSearchResult parentAssetType. + * @member {string} parentAssetType + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.parentAssetType = ""; + + /** + * ResourceSearchResult sccSecurityMarks. + * @member {Object.} sccSecurityMarks + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + */ + ResourceSearchResult.prototype.sccSecurityMarks = $util.emptyObject; + + /** + * Creates a new ResourceSearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult instance + */ + ResourceSearchResult.create = function create(properties) { + return new ResourceSearchResult(properties); + }; + + /** + * Encodes the specified ResourceSearchResult message. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.location); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.networkTags[i]); + if (message.additionalAttributes != null && Object.hasOwnProperty.call(message, "additionalAttributes")) + $root.google.protobuf.Struct.encode(message.additionalAttributes, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.kmsKey); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.state); + if (message.versionedResources != null && message.versionedResources.length) + for (var i = 0; i < message.versionedResources.length; ++i) + $root.google.cloud.asset.v1.VersionedResource.encode(message.versionedResources[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.folders[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.organization); + if (message.parentFullResourceName != null && Object.hasOwnProperty.call(message, "parentFullResourceName")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.parentFullResourceName); + if (message.attachedResources != null && message.attachedResources.length) + for (var i = 0; i < message.attachedResources.length; ++i) + $root.google.cloud.asset.v1.AttachedResource.encode(message.attachedResources[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.relationships != null && Object.hasOwnProperty.call(message, "relationships")) + for (var keys = Object.keys(message.relationships), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 21, wireType 2 =*/170).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1.RelatedResources.encode(message.relationships[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.tagKeys != null && message.tagKeys.length) + for (var i = 0; i < message.tagKeys.length; ++i) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.tagKeys[i]); + if (message.tagValues != null && message.tagValues.length) + for (var i = 0; i < message.tagValues.length; ++i) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.tagValues[i]); + if (message.tagValueIds != null && message.tagValueIds.length) + for (var i = 0; i < message.tagValueIds.length; ++i) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.tagValueIds[i]); + if (message.kmsKeys != null && message.kmsKeys.length) + for (var i = 0; i < message.kmsKeys.length; ++i) + writer.uint32(/* id 28, wireType 2 =*/226).string(message.kmsKeys[i]); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + $root.google.cloud.asset.v1.Tag.encode(message.tags[i], writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.effectiveTags != null && message.effectiveTags.length) + for (var i = 0; i < message.effectiveTags.length; ++i) + $root.google.cloud.asset.v1.EffectiveTagDetails.encode(message.effectiveTags[i], writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.sccSecurityMarks != null && Object.hasOwnProperty.call(message, "sccSecurityMarks")) + for (var keys = Object.keys(message.sccSecurityMarks), i = 0; i < keys.length; ++i) + writer.uint32(/* id 32, wireType 2 =*/258).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.sccSecurityMarks[keys[i]]).ldelim(); + if (message.parentAssetType != null && Object.hasOwnProperty.call(message, "parentAssetType")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.parentAssetType); + return writer; + }; + + /** + * Encodes the specified ResourceSearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ResourceSearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.IResourceSearchResult} message ResourceSearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceSearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSearchResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ResourceSearchResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 17: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + case 18: { + message.organization = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.location = reader.string(); + break; + } + case 7: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 8: { + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + } + case 10: { + message.kmsKey = reader.string(); + break; + } + case 28: { + if (!(message.kmsKeys && message.kmsKeys.length)) + message.kmsKeys = []; + message.kmsKeys.push(reader.string()); + break; + } + case 11: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.state = reader.string(); + break; + } + case 9: { + message.additionalAttributes = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 19: { + message.parentFullResourceName = reader.string(); + break; + } + case 16: { + if (!(message.versionedResources && message.versionedResources.length)) + message.versionedResources = []; + message.versionedResources.push($root.google.cloud.asset.v1.VersionedResource.decode(reader, reader.uint32())); + break; + } + case 20: { + if (!(message.attachedResources && message.attachedResources.length)) + message.attachedResources = []; + message.attachedResources.push($root.google.cloud.asset.v1.AttachedResource.decode(reader, reader.uint32())); + break; + } + case 21: { + if (message.relationships === $util.emptyObject) + message.relationships = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.RelatedResources.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.relationships[key] = value; + break; + } + case 23: { + if (!(message.tagKeys && message.tagKeys.length)) + message.tagKeys = []; + message.tagKeys.push(reader.string()); + break; + } + case 25: { + if (!(message.tagValues && message.tagValues.length)) + message.tagValues = []; + message.tagValues.push(reader.string()); + break; + } + case 26: { + if (!(message.tagValueIds && message.tagValueIds.length)) + message.tagValueIds = []; + message.tagValueIds.push(reader.string()); + break; + } + case 29: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push($root.google.cloud.asset.v1.Tag.decode(reader, reader.uint32())); + break; + } + case 30: { + if (!(message.effectiveTags && message.effectiveTags.length)) + message.effectiveTags = []; + message.effectiveTags.push($root.google.cloud.asset.v1.EffectiveTagDetails.decode(reader, reader.uint32())); + break; + } + case 103: { + message.parentAssetType = reader.string(); + break; + } + case 32: { + if (message.sccSecurityMarks === $util.emptyObject) + message.sccSecurityMarks = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.sccSecurityMarks[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceSearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceSearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceSearchResult message. + * @function verify + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceSearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + if (message.kmsKeys != null && message.hasOwnProperty("kmsKeys")) { + if (!Array.isArray(message.kmsKeys)) + return "kmsKeys: array expected"; + for (var i = 0; i < message.kmsKeys.length; ++i) + if (!$util.isString(message.kmsKeys[i])) + return "kmsKeys: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + if (!$util.isString(message.state)) + return "state: string expected"; + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + var error = $root.google.protobuf.Struct.verify(message.additionalAttributes); + if (error) + return "additionalAttributes." + error; + } + if (message.parentFullResourceName != null && message.hasOwnProperty("parentFullResourceName")) + if (!$util.isString(message.parentFullResourceName)) + return "parentFullResourceName: string expected"; + if (message.versionedResources != null && message.hasOwnProperty("versionedResources")) { + if (!Array.isArray(message.versionedResources)) + return "versionedResources: array expected"; + for (var i = 0; i < message.versionedResources.length; ++i) { + var error = $root.google.cloud.asset.v1.VersionedResource.verify(message.versionedResources[i]); + if (error) + return "versionedResources." + error; + } + } + if (message.attachedResources != null && message.hasOwnProperty("attachedResources")) { + if (!Array.isArray(message.attachedResources)) + return "attachedResources: array expected"; + for (var i = 0; i < message.attachedResources.length; ++i) { + var error = $root.google.cloud.asset.v1.AttachedResource.verify(message.attachedResources[i]); + if (error) + return "attachedResources." + error; + } + } + if (message.relationships != null && message.hasOwnProperty("relationships")) { + if (!$util.isObject(message.relationships)) + return "relationships: object expected"; + var key = Object.keys(message.relationships); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1.RelatedResources.verify(message.relationships[key[i]]); + if (error) + return "relationships." + error; + } + } + if (message.tagKeys != null && message.hasOwnProperty("tagKeys")) { + if (!Array.isArray(message.tagKeys)) + return "tagKeys: array expected"; + for (var i = 0; i < message.tagKeys.length; ++i) + if (!$util.isString(message.tagKeys[i])) + return "tagKeys: string[] expected"; + } + if (message.tagValues != null && message.hasOwnProperty("tagValues")) { + if (!Array.isArray(message.tagValues)) + return "tagValues: array expected"; + for (var i = 0; i < message.tagValues.length; ++i) + if (!$util.isString(message.tagValues[i])) + return "tagValues: string[] expected"; + } + if (message.tagValueIds != null && message.hasOwnProperty("tagValueIds")) { + if (!Array.isArray(message.tagValueIds)) + return "tagValueIds: array expected"; + for (var i = 0; i < message.tagValueIds.length; ++i) + if (!$util.isString(message.tagValueIds[i])) + return "tagValueIds: string[] expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) { + var error = $root.google.cloud.asset.v1.Tag.verify(message.tags[i]); + if (error) + return "tags." + error; + } + } + if (message.effectiveTags != null && message.hasOwnProperty("effectiveTags")) { + if (!Array.isArray(message.effectiveTags)) + return "effectiveTags: array expected"; + for (var i = 0; i < message.effectiveTags.length; ++i) { + var error = $root.google.cloud.asset.v1.EffectiveTagDetails.verify(message.effectiveTags[i]); + if (error) + return "effectiveTags." + error; + } + } + if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) + if (!$util.isString(message.parentAssetType)) + return "parentAssetType: string expected"; + if (message.sccSecurityMarks != null && message.hasOwnProperty("sccSecurityMarks")) { + if (!$util.isObject(message.sccSecurityMarks)) + return "sccSecurityMarks: object expected"; + var key = Object.keys(message.sccSecurityMarks); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.sccSecurityMarks[key[i]])) + return "sccSecurityMarks: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ResourceSearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ResourceSearchResult} ResourceSearchResult + */ + ResourceSearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ResourceSearchResult) + return object; + var message = new $root.google.cloud.asset.v1.ResourceSearchResult(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + if (object.kmsKeys) { + if (!Array.isArray(object.kmsKeys)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.kmsKeys: array expected"); + message.kmsKeys = []; + for (var i = 0; i < object.kmsKeys.length; ++i) + message.kmsKeys[i] = String(object.kmsKeys[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.state != null) + message.state = String(object.state); + if (object.additionalAttributes != null) { + if (typeof object.additionalAttributes !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.additionalAttributes: object expected"); + message.additionalAttributes = $root.google.protobuf.Struct.fromObject(object.additionalAttributes); + } + if (object.parentFullResourceName != null) + message.parentFullResourceName = String(object.parentFullResourceName); + if (object.versionedResources) { + if (!Array.isArray(object.versionedResources)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.versionedResources: array expected"); + message.versionedResources = []; + for (var i = 0; i < object.versionedResources.length; ++i) { + if (typeof object.versionedResources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.versionedResources: object expected"); + message.versionedResources[i] = $root.google.cloud.asset.v1.VersionedResource.fromObject(object.versionedResources[i]); + } + } + if (object.attachedResources) { + if (!Array.isArray(object.attachedResources)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.attachedResources: array expected"); + message.attachedResources = []; + for (var i = 0; i < object.attachedResources.length; ++i) { + if (typeof object.attachedResources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.attachedResources: object expected"); + message.attachedResources[i] = $root.google.cloud.asset.v1.AttachedResource.fromObject(object.attachedResources[i]); + } + } + if (object.relationships) { + if (typeof object.relationships !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.relationships: object expected"); + message.relationships = {}; + for (var keys = Object.keys(object.relationships), i = 0; i < keys.length; ++i) { + if (typeof object.relationships[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.relationships: object expected"); + message.relationships[keys[i]] = $root.google.cloud.asset.v1.RelatedResources.fromObject(object.relationships[keys[i]]); + } + } + if (object.tagKeys) { + if (!Array.isArray(object.tagKeys)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagKeys: array expected"); + message.tagKeys = []; + for (var i = 0; i < object.tagKeys.length; ++i) + message.tagKeys[i] = String(object.tagKeys[i]); + } + if (object.tagValues) { + if (!Array.isArray(object.tagValues)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagValues: array expected"); + message.tagValues = []; + for (var i = 0; i < object.tagValues.length; ++i) + message.tagValues[i] = String(object.tagValues[i]); + } + if (object.tagValueIds) { + if (!Array.isArray(object.tagValueIds)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tagValueIds: array expected"); + message.tagValueIds = []; + for (var i = 0; i < object.tagValueIds.length; ++i) + message.tagValueIds[i] = String(object.tagValueIds[i]); + } + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) { + if (typeof object.tags[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.tags: object expected"); + message.tags[i] = $root.google.cloud.asset.v1.Tag.fromObject(object.tags[i]); + } + } + if (object.effectiveTags) { + if (!Array.isArray(object.effectiveTags)) + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.effectiveTags: array expected"); + message.effectiveTags = []; + for (var i = 0; i < object.effectiveTags.length; ++i) { + if (typeof object.effectiveTags[i] !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.effectiveTags: object expected"); + message.effectiveTags[i] = $root.google.cloud.asset.v1.EffectiveTagDetails.fromObject(object.effectiveTags[i]); + } + } + if (object.parentAssetType != null) + message.parentAssetType = String(object.parentAssetType); + if (object.sccSecurityMarks) { + if (typeof object.sccSecurityMarks !== "object") + throw TypeError(".google.cloud.asset.v1.ResourceSearchResult.sccSecurityMarks: object expected"); + message.sccSecurityMarks = {}; + for (var keys = Object.keys(object.sccSecurityMarks), i = 0; i < keys.length; ++i) + message.sccSecurityMarks[keys[i]] = String(object.sccSecurityMarks[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ResourceSearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {google.cloud.asset.v1.ResourceSearchResult} message ResourceSearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceSearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networkTags = []; + object.versionedResources = []; + object.folders = []; + object.attachedResources = []; + object.tagKeys = []; + object.tagValues = []; + object.tagValueIds = []; + object.kmsKeys = []; + object.tags = []; + object.effectiveTags = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.relationships = {}; + object.sccSecurityMarks = {}; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + object.location = ""; + object.additionalAttributes = null; + object.kmsKey = ""; + object.createTime = null; + object.updateTime = null; + object.state = ""; + object.organization = ""; + object.parentFullResourceName = ""; + object.parentAssetType = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) + object.additionalAttributes = $root.google.protobuf.Struct.toObject(message.additionalAttributes, options); + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = message.state; + if (message.versionedResources && message.versionedResources.length) { + object.versionedResources = []; + for (var j = 0; j < message.versionedResources.length; ++j) + object.versionedResources[j] = $root.google.cloud.asset.v1.VersionedResource.toObject(message.versionedResources[j], options); + } + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + if (message.parentFullResourceName != null && message.hasOwnProperty("parentFullResourceName")) + object.parentFullResourceName = message.parentFullResourceName; + if (message.attachedResources && message.attachedResources.length) { + object.attachedResources = []; + for (var j = 0; j < message.attachedResources.length; ++j) + object.attachedResources[j] = $root.google.cloud.asset.v1.AttachedResource.toObject(message.attachedResources[j], options); + } + if (message.relationships && (keys2 = Object.keys(message.relationships)).length) { + object.relationships = {}; + for (var j = 0; j < keys2.length; ++j) + object.relationships[keys2[j]] = $root.google.cloud.asset.v1.RelatedResources.toObject(message.relationships[keys2[j]], options); + } + if (message.tagKeys && message.tagKeys.length) { + object.tagKeys = []; + for (var j = 0; j < message.tagKeys.length; ++j) + object.tagKeys[j] = message.tagKeys[j]; + } + if (message.tagValues && message.tagValues.length) { + object.tagValues = []; + for (var j = 0; j < message.tagValues.length; ++j) + object.tagValues[j] = message.tagValues[j]; + } + if (message.tagValueIds && message.tagValueIds.length) { + object.tagValueIds = []; + for (var j = 0; j < message.tagValueIds.length; ++j) + object.tagValueIds[j] = message.tagValueIds[j]; + } + if (message.kmsKeys && message.kmsKeys.length) { + object.kmsKeys = []; + for (var j = 0; j < message.kmsKeys.length; ++j) + object.kmsKeys[j] = message.kmsKeys[j]; + } + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = $root.google.cloud.asset.v1.Tag.toObject(message.tags[j], options); + } + if (message.effectiveTags && message.effectiveTags.length) { + object.effectiveTags = []; + for (var j = 0; j < message.effectiveTags.length; ++j) + object.effectiveTags[j] = $root.google.cloud.asset.v1.EffectiveTagDetails.toObject(message.effectiveTags[j], options); + } + if (message.sccSecurityMarks && (keys2 = Object.keys(message.sccSecurityMarks)).length) { + object.sccSecurityMarks = {}; + for (var j = 0; j < keys2.length; ++j) + object.sccSecurityMarks[keys2[j]] = message.sccSecurityMarks[keys2[j]]; + } + if (message.parentAssetType != null && message.hasOwnProperty("parentAssetType")) + object.parentAssetType = message.parentAssetType; + return object; + }; + + /** + * Converts this ResourceSearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @instance + * @returns {Object.} JSON object + */ + ResourceSearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceSearchResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ResourceSearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceSearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ResourceSearchResult"; + }; + + return ResourceSearchResult; + })(); + + v1.VersionedResource = (function() { + + /** + * Properties of a VersionedResource. + * @memberof google.cloud.asset.v1 + * @interface IVersionedResource + * @property {string|null} [version] VersionedResource version + * @property {google.protobuf.IStruct|null} [resource] VersionedResource resource + */ + + /** + * Constructs a new VersionedResource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a VersionedResource. + * @implements IVersionedResource + * @constructor + * @param {google.cloud.asset.v1.IVersionedResource=} [properties] Properties to set + */ + function VersionedResource(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]]; + } + + /** + * VersionedResource version. + * @member {string} version + * @memberof google.cloud.asset.v1.VersionedResource + * @instance + */ + VersionedResource.prototype.version = ""; + + /** + * VersionedResource resource. + * @member {google.protobuf.IStruct|null|undefined} resource + * @memberof google.cloud.asset.v1.VersionedResource + * @instance + */ + VersionedResource.prototype.resource = null; + + /** + * Creates a new VersionedResource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {google.cloud.asset.v1.IVersionedResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.VersionedResource} VersionedResource instance + */ + VersionedResource.create = function create(properties) { + return new VersionedResource(properties); + }; + + /** + * Encodes the specified VersionedResource message. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {google.cloud.asset.v1.IVersionedResource} message VersionedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.protobuf.Struct.encode(message.resource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VersionedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.VersionedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {google.cloud.asset.v1.IVersionedResource} message VersionedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.VersionedResource} VersionedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.VersionedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.resource = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.VersionedResource} VersionedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionedResource message. + * @function verify + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionedResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.protobuf.Struct.verify(message.resource); + if (error) + return "resource." + error; + } + return null; + }; + + /** + * Creates a VersionedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.VersionedResource} VersionedResource + */ + VersionedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.VersionedResource) + return object; + var message = new $root.google.cloud.asset.v1.VersionedResource(); + if (object.version != null) + message.version = String(object.version); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1.VersionedResource.resource: object expected"); + message.resource = $root.google.protobuf.Struct.fromObject(object.resource); + } + return message; + }; + + /** + * Creates a plain object from a VersionedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {google.cloud.asset.v1.VersionedResource} message VersionedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.resource = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.protobuf.Struct.toObject(message.resource, options); + return object; + }; + + /** + * Converts this VersionedResource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.VersionedResource + * @instance + * @returns {Object.} JSON object + */ + VersionedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionedResource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.VersionedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.VersionedResource"; + }; + + return VersionedResource; + })(); + + v1.AttachedResource = (function() { + + /** + * Properties of an AttachedResource. + * @memberof google.cloud.asset.v1 + * @interface IAttachedResource + * @property {string|null} [assetType] AttachedResource assetType + * @property {Array.|null} [versionedResources] AttachedResource versionedResources + */ + + /** + * Constructs a new AttachedResource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an AttachedResource. + * @implements IAttachedResource + * @constructor + * @param {google.cloud.asset.v1.IAttachedResource=} [properties] Properties to set + */ + function AttachedResource(properties) { + this.versionedResources = []; + 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]]; + } + + /** + * AttachedResource assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.AttachedResource + * @instance + */ + AttachedResource.prototype.assetType = ""; + + /** + * AttachedResource versionedResources. + * @member {Array.} versionedResources + * @memberof google.cloud.asset.v1.AttachedResource + * @instance + */ + AttachedResource.prototype.versionedResources = $util.emptyArray; + + /** + * Creates a new AttachedResource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {google.cloud.asset.v1.IAttachedResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.AttachedResource} AttachedResource instance + */ + AttachedResource.create = function create(properties) { + return new AttachedResource(properties); + }; + + /** + * Encodes the specified AttachedResource message. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {google.cloud.asset.v1.IAttachedResource} message AttachedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.assetType); + if (message.versionedResources != null && message.versionedResources.length) + for (var i = 0; i < message.versionedResources.length; ++i) + $root.google.cloud.asset.v1.VersionedResource.encode(message.versionedResources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttachedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.AttachedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {google.cloud.asset.v1.IAttachedResource} message AttachedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.AttachedResource} AttachedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.AttachedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.assetType = reader.string(); + break; + } + case 3: { + if (!(message.versionedResources && message.versionedResources.length)) + message.versionedResources = []; + message.versionedResources.push($root.google.cloud.asset.v1.VersionedResource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.AttachedResource} AttachedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedResource message. + * @function verify + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.versionedResources != null && message.hasOwnProperty("versionedResources")) { + if (!Array.isArray(message.versionedResources)) + return "versionedResources: array expected"; + for (var i = 0; i < message.versionedResources.length; ++i) { + var error = $root.google.cloud.asset.v1.VersionedResource.verify(message.versionedResources[i]); + if (error) + return "versionedResources." + error; + } + } + return null; + }; + + /** + * Creates an AttachedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.AttachedResource} AttachedResource + */ + AttachedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.AttachedResource) + return object; + var message = new $root.google.cloud.asset.v1.AttachedResource(); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.versionedResources) { + if (!Array.isArray(object.versionedResources)) + throw TypeError(".google.cloud.asset.v1.AttachedResource.versionedResources: array expected"); + message.versionedResources = []; + for (var i = 0; i < object.versionedResources.length; ++i) { + if (typeof object.versionedResources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.AttachedResource.versionedResources: object expected"); + message.versionedResources[i] = $root.google.cloud.asset.v1.VersionedResource.fromObject(object.versionedResources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AttachedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {google.cloud.asset.v1.AttachedResource} message AttachedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.versionedResources = []; + if (options.defaults) + object.assetType = ""; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.versionedResources && message.versionedResources.length) { + object.versionedResources = []; + for (var j = 0; j < message.versionedResources.length; ++j) + object.versionedResources[j] = $root.google.cloud.asset.v1.VersionedResource.toObject(message.versionedResources[j], options); + } + return object; + }; + + /** + * Converts this AttachedResource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.AttachedResource + * @instance + * @returns {Object.} JSON object + */ + AttachedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedResource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.AttachedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.AttachedResource"; + }; + + return AttachedResource; + })(); + + v1.RelatedResources = (function() { + + /** + * Properties of a RelatedResources. + * @memberof google.cloud.asset.v1 + * @interface IRelatedResources + * @property {Array.|null} [relatedResources] RelatedResources relatedResources + */ + + /** + * Constructs a new RelatedResources. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedResources. + * @implements IRelatedResources + * @constructor + * @param {google.cloud.asset.v1.IRelatedResources=} [properties] Properties to set + */ + function RelatedResources(properties) { + this.relatedResources = []; + 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]]; + } + + /** + * RelatedResources relatedResources. + * @member {Array.} relatedResources + * @memberof google.cloud.asset.v1.RelatedResources + * @instance + */ + RelatedResources.prototype.relatedResources = $util.emptyArray; + + /** + * Creates a new RelatedResources instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {google.cloud.asset.v1.IRelatedResources=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedResources} RelatedResources instance + */ + RelatedResources.create = function create(properties) { + return new RelatedResources(properties); + }; + + /** + * Encodes the specified RelatedResources message. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {google.cloud.asset.v1.IRelatedResources} message RelatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relatedResources != null && message.relatedResources.length) + for (var i = 0; i < message.relatedResources.length; ++i) + $root.google.cloud.asset.v1.RelatedResource.encode(message.relatedResources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RelatedResources message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {google.cloud.asset.v1.IRelatedResources} message RelatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedResources} RelatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedResources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.RelatedResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.relatedResources && message.relatedResources.length)) + message.relatedResources = []; + message.relatedResources.push($root.google.cloud.asset.v1.RelatedResource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedResources} RelatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedResources message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relatedResources != null && message.hasOwnProperty("relatedResources")) { + if (!Array.isArray(message.relatedResources)) + return "relatedResources: array expected"; + for (var i = 0; i < message.relatedResources.length; ++i) { + var error = $root.google.cloud.asset.v1.RelatedResource.verify(message.relatedResources[i]); + if (error) + return "relatedResources." + error; + } + } + return null; + }; + + /** + * Creates a RelatedResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedResources} RelatedResources + */ + RelatedResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedResources) + return object; + var message = new $root.google.cloud.asset.v1.RelatedResources(); + if (object.relatedResources) { + if (!Array.isArray(object.relatedResources)) + throw TypeError(".google.cloud.asset.v1.RelatedResources.relatedResources: array expected"); + message.relatedResources = []; + for (var i = 0; i < object.relatedResources.length; ++i) { + if (typeof object.relatedResources[i] !== "object") + throw TypeError(".google.cloud.asset.v1.RelatedResources.relatedResources: object expected"); + message.relatedResources[i] = $root.google.cloud.asset.v1.RelatedResource.fromObject(object.relatedResources[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RelatedResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {google.cloud.asset.v1.RelatedResources} message RelatedResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relatedResources = []; + if (message.relatedResources && message.relatedResources.length) { + object.relatedResources = []; + for (var j = 0; j < message.relatedResources.length; ++j) + object.relatedResources[j] = $root.google.cloud.asset.v1.RelatedResource.toObject(message.relatedResources[j], options); + } + return object; + }; + + /** + * Converts this RelatedResources to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedResources + * @instance + * @returns {Object.} JSON object + */ + RelatedResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelatedResources + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelatedResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelatedResources"; + }; + + return RelatedResources; + })(); + + v1.RelatedResource = (function() { + + /** + * Properties of a RelatedResource. + * @memberof google.cloud.asset.v1 + * @interface IRelatedResource + * @property {string|null} [assetType] RelatedResource assetType + * @property {string|null} [fullResourceName] RelatedResource fullResourceName + */ + + /** + * Constructs a new RelatedResource. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedResource. + * @implements IRelatedResource + * @constructor + * @param {google.cloud.asset.v1.IRelatedResource=} [properties] Properties to set + */ + function RelatedResource(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]]; + } + + /** + * RelatedResource assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.RelatedResource + * @instance + */ + RelatedResource.prototype.assetType = ""; + + /** + * RelatedResource fullResourceName. + * @member {string} fullResourceName + * @memberof google.cloud.asset.v1.RelatedResource + * @instance + */ + RelatedResource.prototype.fullResourceName = ""; + + /** + * Creates a new RelatedResource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {google.cloud.asset.v1.IRelatedResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedResource} RelatedResource instance + */ + RelatedResource.create = function create(properties) { + return new RelatedResource(properties); + }; + + /** + * Encodes the specified RelatedResource message. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {google.cloud.asset.v1.IRelatedResource} message RelatedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.assetType); + if (message.fullResourceName != null && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullResourceName); + return writer; + }; + + /** + * Encodes the specified RelatedResource message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {google.cloud.asset.v1.IRelatedResource} message RelatedResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedResource} RelatedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.RelatedResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.assetType = reader.string(); + break; + } + case 2: { + message.fullResourceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedResource} RelatedResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedResource message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + if (!$util.isString(message.fullResourceName)) + return "fullResourceName: string expected"; + return null; + }; + + /** + * Creates a RelatedResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedResource} RelatedResource + */ + RelatedResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedResource) + return object; + var message = new $root.google.cloud.asset.v1.RelatedResource(); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.fullResourceName != null) + message.fullResourceName = String(object.fullResourceName); + return message; + }; + + /** + * Creates a plain object from a RelatedResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {google.cloud.asset.v1.RelatedResource} message RelatedResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.assetType = ""; + object.fullResourceName = ""; + } + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.fullResourceName != null && message.hasOwnProperty("fullResourceName")) + object.fullResourceName = message.fullResourceName; + return object; + }; + + /** + * Converts this RelatedResource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedResource + * @instance + * @returns {Object.} JSON object + */ + RelatedResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelatedResource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.RelatedResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.RelatedResource"; + }; + + return RelatedResource; + })(); + + v1.IamPolicySearchResult = (function() { + + /** + * Properties of an IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [assetType] IamPolicySearchResult assetType + * @property {string|null} [project] IamPolicySearchResult project + * @property {Array.|null} [folders] IamPolicySearchResult folders + * @property {string|null} [organization] IamPolicySearchResult organization + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy + * @property {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation + */ + + /** + * Constructs a new IamPolicySearchResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult + * @constructor + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + */ + function IamPolicySearchResult(properties) { + this.folders = []; + 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]]; + } + + /** + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.resource = ""; + + /** + * IamPolicySearchResult assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.assetType = ""; + + /** + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.project = ""; + + /** + * IamPolicySearchResult folders. + * @member {Array.} folders + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.folders = $util.emptyArray; + + /** + * IamPolicySearchResult organization. + * @member {string} organization + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.organization = ""; + + /** + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; + + /** + * IamPolicySearchResult explanation. + * @member {google.cloud.asset.v1.IamPolicySearchResult.IExplanation|null|undefined} explanation + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.explanation = null; + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult instance + */ + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); + }; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.project); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.assetType); + if (message.folders != null && message.folders.length) + for (var i = 0; i < message.folders.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.folders[i]); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.organization); + return writer; + }; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 5: { + message.assetType = reader.string(); + break; + } + case 2: { + message.project = reader.string(); + break; + } + case 6: { + if (!(message.folders && message.folders.length)) + message.folders = []; + message.folders.push(reader.string()); + break; + } + case 7: { + message.organization = reader.string(); + break; + } + case 3: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 4: { + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicySearchResult message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicySearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.folders != null && message.hasOwnProperty("folders")) { + if (!Array.isArray(message.folders)) + return "folders: array expected"; + for (var i = 0; i < message.folders.length; ++i) + if (!$util.isString(message.folders[i])) + return "folders: string[] expected"; + } + if (message.organization != null && message.hasOwnProperty("organization")) + if (!$util.isString(message.organization)) + return "organization: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify(message.explanation); + if (error) + return "explanation." + error; + } + return null; + }; + + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult} IamPolicySearchResult + */ + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.folders) { + if (!Array.isArray(object.folders)) + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.folders: array expected"); + message.folders = []; + for (var i = 0; i < object.folders.length; ++i) + message.folders[i] = String(object.folders[i]); + } + if (object.organization != null) + message.organization = String(object.organization); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.explanation != null) { + if (typeof object.explanation !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.explanation: object expected"); + message.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.fromObject(object.explanation); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult} message IamPolicySearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicySearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.folders = []; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.policy = null; + object.explanation = null; + object.assetType = ""; + object.organization = ""; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.folders && message.folders.length) { + object.folders = []; + for (var j = 0; j < message.folders.length; ++j) + object.folders[j] = message.folders[j]; + } + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = message.organization; + return object; + }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicySearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicySearchResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicySearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicySearchResult"; + }; + + IamPolicySearchResult.Explanation = (function() { + + /** + * Properties of an Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @interface IExplanation + * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions + */ + + /** + * Constructs a new Explanation. + * @memberof google.cloud.asset.v1.IamPolicySearchResult + * @classdesc Represents an Explanation. + * @implements IExplanation + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + */ + function Explanation(properties) { + this.matchedPermissions = {}; + 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]]; + } + + /** + * Explanation matchedPermissions. + * @member {Object.} matchedPermissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @instance + */ + Explanation.prototype.matchedPermissions = $util.emptyObject; + + /** + * Creates a new Explanation instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation instance + */ + Explanation.create = function create(properties) { + return new Explanation(properties); + }; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) + for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchedPermissions[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explanation message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explanation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { + if (!$util.isObject(message.matchedPermissions)) + return "matchedPermissions: object expected"; + var key = Object.keys(message.matchedPermissions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify(message.matchedPermissions[key[i]]); + if (error) + return "matchedPermissions." + error; + } + } + return null; + }; + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation} Explanation + */ + Explanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation(); + if (object.matchedPermissions) { + if (typeof object.matchedPermissions !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions = {}; + for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { + if (typeof object.matchedPermissions[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.fromObject(object.matchedPermissions[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation} message Explanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explanation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.matchedPermissions = {}; + var keys2; + if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { + object.matchedPermissions = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.toObject(message.matchedPermissions[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Explanation to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @instance + * @returns {Object.} JSON object + */ + Explanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Explanation + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Explanation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicySearchResult.Explanation"; + }; + + Explanation.Permissions = (function() { + + /** + * Properties of a Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @interface IPermissions + * @property {Array.|null} [permissions] Permissions permissions + */ + + /** + * Constructs a new Permissions. + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation + * @classdesc Represents a Permissions. + * @implements IPermissions + * @constructor + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + */ + function Permissions(properties) { + 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]]; + } + + /** + * Permissions permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + */ + Permissions.prototype.permissions = $util.emptyArray; + + /** + * Creates a new Permissions instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions instance + */ + Permissions.create = function create(properties) { + return new Permissions(properties); + }; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permissions message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permissions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 a Permissions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} Permissions + */ + Permissions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions.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 a Permissions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions} message Permissions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permissions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + 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 Permissions to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @instance + * @returns {Object.} JSON object + */ + Permissions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Permissions + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Permissions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicySearchResult.Explanation.Permissions"; + }; + + return Permissions; + })(); + + return Explanation; + })(); + + return IamPolicySearchResult; + })(); + + v1.IamPolicyAnalysisState = (function() { + + /** + * Properties of an IamPolicyAnalysisState. + * @memberof google.cloud.asset.v1 + * @interface IIamPolicyAnalysisState + * @property {google.rpc.Code|null} [code] IamPolicyAnalysisState code + * @property {string|null} [cause] IamPolicyAnalysisState cause + */ + + /** + * Constructs a new IamPolicyAnalysisState. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisState. + * @implements IIamPolicyAnalysisState + * @constructor + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState=} [properties] Properties to set + */ + function IamPolicyAnalysisState(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]]; + } + + /** + * IamPolicyAnalysisState code. + * @member {google.rpc.Code} code + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + */ + IamPolicyAnalysisState.prototype.code = 0; + + /** + * IamPolicyAnalysisState cause. + * @member {string} cause + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + */ + IamPolicyAnalysisState.prototype.cause = ""; + + /** + * Creates a new IamPolicyAnalysisState instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState instance + */ + IamPolicyAnalysisState.create = function create(properties) { + return new IamPolicyAnalysisState(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisState message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState} message IamPolicyAnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.cause != null && Object.hasOwnProperty.call(message, "cause")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.cause); + return writer; + }; + + /** + * Encodes the specified IamPolicyAnalysisState message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisState} message IamPolicyAnalysisState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicyAnalysisState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicyAnalysisState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.IamPolicyAnalysisState(); + 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 IamPolicyAnalysisState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicyAnalysisState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicyAnalysisState message. + * @function verify + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicyAnalysisState.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 IamPolicyAnalysisState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisState} IamPolicyAnalysisState + */ + IamPolicyAnalysisState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisState) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisState(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + 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 IamPolicyAnalysisState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisState} message IamPolicyAnalysisState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicyAnalysisState.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] === undefined ? message.code : $root.google.rpc.Code[message.code] : message.code; + if (message.cause != null && message.hasOwnProperty("cause")) + object.cause = message.cause; + return object; + }; + + /** + * Converts this IamPolicyAnalysisState to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicyAnalysisState + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisState"; + }; + + return IamPolicyAnalysisState; + })(); + + v1.ConditionEvaluation = (function() { + + /** + * Properties of a ConditionEvaluation. + * @memberof google.cloud.asset.v1 + * @interface IConditionEvaluation + * @property {google.cloud.asset.v1.ConditionEvaluation.EvaluationValue|null} [evaluationValue] ConditionEvaluation evaluationValue + */ + + /** + * Constructs a new ConditionEvaluation. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a ConditionEvaluation. + * @implements IConditionEvaluation + * @constructor + * @param {google.cloud.asset.v1.IConditionEvaluation=} [properties] Properties to set + */ + function ConditionEvaluation(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]]; + } + + /** + * ConditionEvaluation evaluationValue. + * @member {google.cloud.asset.v1.ConditionEvaluation.EvaluationValue} evaluationValue + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @instance + */ + ConditionEvaluation.prototype.evaluationValue = 0; + + /** + * Creates a new ConditionEvaluation instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {google.cloud.asset.v1.IConditionEvaluation=} [properties] Properties to set + * @returns {google.cloud.asset.v1.ConditionEvaluation} ConditionEvaluation instance + */ + ConditionEvaluation.create = function create(properties) { + return new ConditionEvaluation(properties); + }; + + /** + * Encodes the specified ConditionEvaluation message. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {google.cloud.asset.v1.IConditionEvaluation} message ConditionEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionEvaluation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.evaluationValue != null && Object.hasOwnProperty.call(message, "evaluationValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.evaluationValue); + return writer; + }; + + /** + * Encodes the specified ConditionEvaluation message, length delimited. Does not implicitly {@link google.cloud.asset.v1.ConditionEvaluation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {google.cloud.asset.v1.IConditionEvaluation} message ConditionEvaluation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConditionEvaluation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.ConditionEvaluation} ConditionEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionEvaluation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.ConditionEvaluation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.evaluationValue = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConditionEvaluation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.ConditionEvaluation} ConditionEvaluation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConditionEvaluation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConditionEvaluation message. + * @function verify + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConditionEvaluation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.evaluationValue != null && message.hasOwnProperty("evaluationValue")) + switch (message.evaluationValue) { + default: + return "evaluationValue: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ConditionEvaluation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.ConditionEvaluation} ConditionEvaluation + */ + ConditionEvaluation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.ConditionEvaluation) + return object; + var message = new $root.google.cloud.asset.v1.ConditionEvaluation(); + switch (object.evaluationValue) { + default: + if (typeof object.evaluationValue === "number") { + message.evaluationValue = object.evaluationValue; + break; + } + break; + case "EVALUATION_VALUE_UNSPECIFIED": + case 0: + message.evaluationValue = 0; + break; + case "TRUE": + case 1: + message.evaluationValue = 1; + break; + case "FALSE": + case 2: + message.evaluationValue = 2; + break; + case "CONDITIONAL": + case 3: + message.evaluationValue = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ConditionEvaluation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {google.cloud.asset.v1.ConditionEvaluation} message ConditionEvaluation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConditionEvaluation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.evaluationValue = options.enums === String ? "EVALUATION_VALUE_UNSPECIFIED" : 0; + if (message.evaluationValue != null && message.hasOwnProperty("evaluationValue")) + object.evaluationValue = options.enums === String ? $root.google.cloud.asset.v1.ConditionEvaluation.EvaluationValue[message.evaluationValue] === undefined ? message.evaluationValue : $root.google.cloud.asset.v1.ConditionEvaluation.EvaluationValue[message.evaluationValue] : message.evaluationValue; + return object; + }; + + /** + * Converts this ConditionEvaluation to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @instance + * @returns {Object.} JSON object + */ + ConditionEvaluation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConditionEvaluation + * @function getTypeUrl + * @memberof google.cloud.asset.v1.ConditionEvaluation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConditionEvaluation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.ConditionEvaluation"; + }; + + /** + * EvaluationValue enum. + * @name google.cloud.asset.v1.ConditionEvaluation.EvaluationValue + * @enum {number} + * @property {number} EVALUATION_VALUE_UNSPECIFIED=0 EVALUATION_VALUE_UNSPECIFIED value + * @property {number} TRUE=1 TRUE value + * @property {number} FALSE=2 FALSE value + * @property {number} CONDITIONAL=3 CONDITIONAL value + */ + ConditionEvaluation.EvaluationValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EVALUATION_VALUE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRUE"] = 1; + values[valuesById[2] = "FALSE"] = 2; + values[valuesById[3] = "CONDITIONAL"] = 3; + return values; + })(); + + return ConditionEvaluation; + })(); + + v1.IamPolicyAnalysisResult = (function() { + + /** + * Properties of an IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1 + * @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.v1.IamPolicyAnalysisResult.IIdentityList|null} [identityList] IamPolicyAnalysisResult identityList + * @property {boolean|null} [fullyExplored] IamPolicyAnalysisResult fullyExplored + */ + + /** + * Constructs a new IamPolicyAnalysisResult. + * @memberof google.cloud.asset.v1 + * @classdesc Represents an IamPolicyAnalysisResult. + * @implements IIamPolicyAnalysisResult + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.attachedResourceFullName = ""; + + /** + * IamPolicyAnalysisResult iamBinding. + * @member {google.iam.v1.IBinding|null|undefined} iamBinding + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.iamBinding = null; + + /** + * IamPolicyAnalysisResult accessControlLists. + * @member {Array.} accessControlLists + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.accessControlLists = $util.emptyArray; + + /** + * IamPolicyAnalysisResult identityList. + * @member {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList|null|undefined} identityList + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.identityList = null; + + /** + * IamPolicyAnalysisResult fullyExplored. + * @member {boolean} fullyExplored + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @instance + */ + IamPolicyAnalysisResult.prototype.fullyExplored = false; + + /** + * Creates a new IamPolicyAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.IIamPolicyAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult instance + */ + IamPolicyAnalysisResult.create = function create(properties) { + return new IamPolicyAnalysisResult(properties); + }; + + /** + * Encodes the specified IamPolicyAnalysisResult message. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "attachedResourceFullName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.attachedResourceFullName); + if (message.iamBinding != null && Object.hasOwnProperty.call(message, "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.v1.IamPolicyAnalysisResult.AccessControlList.encode(message.accessControlLists[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.identityList != null && Object.hasOwnProperty.call(message, "identityList")) + $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList.encode(message.identityList, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.fullyExplored != null && Object.hasOwnProperty.call(message, "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.v1.IamPolicyAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.AccessControlList.decode(reader, reader.uint32())); + break; + } + case 4: { + message.identityList = $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisResult.AccessControlList.verify(message.accessControlLists[i]); + if (error) + return "accessControlLists." + error; + } + } + if (message.identityList != null && message.hasOwnProperty("identityList")) { + var error = $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult} IamPolicyAnalysisResult + */ + IamPolicyAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult(); + if (object.attachedResourceFullName != null) + message.attachedResourceFullName = String(object.attachedResourceFullName); + if (object.iamBinding != null) { + if (typeof object.iamBinding !== "object") + throw TypeError(".google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisResult.accessControlLists: object expected"); + message.accessControlLists[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.fromObject(object.accessControlLists[i]); + } + } + if (object.identityList != null) { + if (typeof object.identityList !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.identityList: object expected"); + message.identityList = $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.AccessControlList.toObject(message.accessControlLists[j], options); + } + if (message.identityList != null && message.hasOwnProperty("identityList")) + object.identityList = $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicyAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicyAnalysisResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicyAnalysisResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult"; + }; + + IamPolicyAnalysisResult.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IResource + * @property {string|null} [fullResourceName] Resource fullResourceName + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Resource analysisState + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.fullResourceName = ""; + + /** + * Resource analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @instance + */ + Resource.prototype.analysisState = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "fullResourceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullResourceName); + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource) + return object; + var message = new $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Resource.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.Resource"; + }; + + return Resource; + })(); + + IamPolicyAnalysisResult.Access = (function() { + + /** + * Properties of an Access. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IAccess + * @property {string|null} [role] Access role + * @property {string|null} [permission] Access permission + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Access analysisState + */ + + /** + * Constructs a new Access. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Access. + * @implements IAccess + * @constructor + * @param {google.cloud.asset.v1.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|null|undefined} role + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.role = null; + + /** + * Access permission. + * @member {string|null|undefined} permission + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + */ + Access.prototype.permission = null; + + /** + * Access analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccess=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Access.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Access + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Access + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Access} Access + */ + Access.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access) + return object; + var message = new $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Access.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Access + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Access to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @instance + * @returns {Object.} JSON object + */ + Access.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Access + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Access + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Access.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.Access"; + }; + + return Access; + })(); + + IamPolicyAnalysisResult.Identity = (function() { + + /** + * Properties of an Identity. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IIdentity + * @property {string|null} [name] Identity name + * @property {google.cloud.asset.v1.IIamPolicyAnalysisState|null} [analysisState] Identity analysisState + */ + + /** + * Constructs a new Identity. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Identity. + * @implements IIdentity + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.name = ""; + + /** + * Identity analysisState. + * @member {google.cloud.asset.v1.IIamPolicyAnalysisState|null|undefined} analysisState + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @instance + */ + Identity.prototype.analysisState = null; + + /** + * Creates a new Identity instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentity=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.analysisState != null && Object.hasOwnProperty.call(message, "analysisState")) + $root.google.cloud.asset.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Identity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Identity} Identity + */ + Identity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity) + return object; + var message = new $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Identity.analysisState: object expected"); + message.analysisState = $root.google.cloud.asset.v1.IamPolicyAnalysisState.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.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisState.toObject(message.analysisState, options); + return object; + }; + + /** + * Converts this Identity to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @instance + * @returns {Object.} JSON object + */ + Identity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Identity + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Identity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Identity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.Identity"; + }; + + return Identity; + })(); + + IamPolicyAnalysisResult.Edge = (function() { + + /** + * Properties of an Edge. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IEdge + * @property {string|null} [sourceNode] Edge sourceNode + * @property {string|null} [targetNode] Edge targetNode + */ + + /** + * Constructs a new Edge. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an Edge. + * @implements IEdge + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.sourceNode = ""; + + /** + * Edge targetNode. + * @member {string} targetNode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @instance + */ + Edge.prototype.targetNode = ""; + + /** + * Creates a new Edge instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IEdge=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.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 && Object.hasOwnProperty.call(message, "sourceNode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceNode); + if (message.targetNode != null && Object.hasOwnProperty.call(message, "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.v1.IamPolicyAnalysisResult.Edge.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.Edge} Edge + */ + Edge.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge) + return object; + var message = new $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.Edge + * @instance + * @returns {Object.} JSON object + */ + Edge.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Edge + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.Edge + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Edge.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.Edge"; + }; + + return Edge; + })(); + + IamPolicyAnalysisResult.AccessControlList = (function() { + + /** + * Properties of an AccessControlList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IAccessControlList + * @property {Array.|null} [resources] AccessControlList resources + * @property {Array.|null} [accesses] AccessControlList accesses + * @property {Array.|null} [resourceEdges] AccessControlList resourceEdges + * @property {google.cloud.asset.v1.IConditionEvaluation|null} [conditionEvaluation] AccessControlList conditionEvaluation + */ + + /** + * Constructs a new AccessControlList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an AccessControlList. + * @implements IAccessControlList + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resources = $util.emptyArray; + + /** + * AccessControlList accesses. + * @member {Array.} accesses + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.accesses = $util.emptyArray; + + /** + * AccessControlList resourceEdges. + * @member {Array.} resourceEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.resourceEdges = $util.emptyArray; + + /** + * AccessControlList conditionEvaluation. + * @member {google.cloud.asset.v1.IConditionEvaluation|null|undefined} conditionEvaluation + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + */ + AccessControlList.prototype.conditionEvaluation = null; + + /** + * Creates a new AccessControlList instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IAccessControlList=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.Edge.encode(message.resourceEdges[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.conditionEvaluation != null && Object.hasOwnProperty.call(message, "conditionEvaluation")) + $root.google.cloud.asset.v1.ConditionEvaluation.encode(message.conditionEvaluation, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessControlList message, length delimited. Does not implicitly {@link google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.Resource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.accesses && message.accesses.length)) + message.accesses = []; + message.accesses.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.resourceEdges && message.resourceEdges.length)) + message.resourceEdges = []; + message.resourceEdges.push($root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.decode(reader, reader.uint32())); + break; + } + case 4: { + message.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.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.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.Edge.verify(message.resourceEdges[i]); + if (error) + return "resourceEdges." + error; + } + } + if (message.conditionEvaluation != null && message.hasOwnProperty("conditionEvaluation")) { + var error = $root.google.cloud.asset.v1.ConditionEvaluation.verify(message.conditionEvaluation); + if (error) + return "conditionEvaluation." + 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.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList} AccessControlList + */ + AccessControlList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.AccessControlList.resources: object expected"); + message.resources[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Resource.fromObject(object.resources[i]); + } + } + if (object.accesses) { + if (!Array.isArray(object.accesses)) + throw TypeError(".google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.AccessControlList.accesses: object expected"); + message.accesses[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Access.fromObject(object.accesses[i]); + } + } + if (object.resourceEdges) { + if (!Array.isArray(object.resourceEdges)) + throw TypeError(".google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.AccessControlList.resourceEdges: object expected"); + message.resourceEdges[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Edge.fromObject(object.resourceEdges[i]); + } + } + if (object.conditionEvaluation != null) { + if (typeof object.conditionEvaluation !== "object") + throw TypeError(".google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList.conditionEvaluation: object expected"); + message.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.fromObject(object.conditionEvaluation); + } + return message; + }; + + /** + * Creates a plain object from an AccessControlList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {google.cloud.asset.v1.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 (options.defaults) + object.conditionEvaluation = null; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = $root.google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisResult.Edge.toObject(message.resourceEdges[j], options); + } + if (message.conditionEvaluation != null && message.hasOwnProperty("conditionEvaluation")) + object.conditionEvaluation = $root.google.cloud.asset.v1.ConditionEvaluation.toObject(message.conditionEvaluation, options); + return object; + }; + + /** + * Converts this AccessControlList to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @instance + * @returns {Object.} JSON object + */ + AccessControlList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessControlList + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessControlList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.AccessControlList"; + }; + + return AccessControlList; + })(); + + IamPolicyAnalysisResult.IdentityList = (function() { + + /** + * Properties of an IdentityList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @interface IIdentityList + * @property {Array.|null} [identities] IdentityList identities + * @property {Array.|null} [groupEdges] IdentityList groupEdges + */ + + /** + * Constructs a new IdentityList. + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult + * @classdesc Represents an IdentityList. + * @implements IIdentityList + * @constructor + * @param {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IdentityList + * @instance + */ + IdentityList.prototype.identities = $util.emptyArray; + + /** + * IdentityList groupEdges. + * @member {Array.} groupEdges + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @instance + */ + IdentityList.prototype.groupEdges = $util.emptyArray; + + /** + * Creates a new IdentityList instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1.IamPolicyAnalysisResult.IIdentityList=} [properties] Properties to set + * @returns {google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.IdentityList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.Identity.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.groupEdges && message.groupEdges.length)) + message.groupEdges = []; + message.groupEdges.push($root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.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.v1.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.v1.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.v1.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.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList} IdentityList + */ + IdentityList.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList) + return object; + var message = new $root.google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IdentityList.identities: object expected"); + message.identities[i] = $root.google.cloud.asset.v1.IamPolicyAnalysisResult.Identity.fromObject(object.identities[i]); + } + } + if (object.groupEdges) { + if (!Array.isArray(object.groupEdges)) + throw TypeError(".google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IdentityList.groupEdges: object expected"); + message.groupEdges[i] = $root.google.cloud.asset.v1.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.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {google.cloud.asset.v1.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.v1.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.v1.IamPolicyAnalysisResult.Edge.toObject(message.groupEdges[j], options); + } + return object; + }; + + /** + * Converts this IdentityList to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @instance + * @returns {Object.} JSON object + */ + IdentityList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IdentityList + * @function getTypeUrl + * @memberof google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IdentityList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1.IamPolicyAnalysisResult.IdentityList"; + }; + + return IdentityList; + })(); + + return IamPolicyAnalysisResult; + })(); + + return v1; + })(); + + return asset; + })(); + + cloud.orgpolicy = (function() { + + /** + * Namespace orgpolicy. + * @memberof google.cloud + * @namespace + */ + var orgpolicy = {}; + + orgpolicy.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.orgpolicy + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.cloud.orgpolicy.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {string|null} [constraint] Policy constraint + * @property {Uint8Array|null} [etag] Policy etag + * @property {google.protobuf.ITimestamp|null} [updateTime] Policy updateTime + * @property {google.cloud.orgpolicy.v1.Policy.IListPolicy|null} [listPolicy] Policy listPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null} [booleanPolicy] Policy booleanPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null} [restoreDefault] Policy restoreDefault + */ + + /** + * Constructs a new Policy. + * @memberof google.cloud.orgpolicy.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + */ + function Policy(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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy constraint. + * @member {string} constraint + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.constraint = ""; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Policy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.updateTime = null; + + /** + * Policy listPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IListPolicy|null|undefined} listPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.listPolicy = null; + + /** + * Policy booleanPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null|undefined} booleanPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.booleanPolicy = null; + + /** + * Policy restoreDefault. + * @member {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null|undefined} restoreDefault + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.restoreDefault = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Policy policyType. + * @member {"listPolicy"|"booleanPolicy"|"restoreDefault"|undefined} policyType + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Object.defineProperty(Policy.prototype, "policyType", { + get: $util.oneOfGetter($oneOfFields = ["listPolicy", "booleanPolicy", "restoreDefault"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.listPolicy != null && Object.hasOwnProperty.call(message, "listPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.encode(message.listPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.booleanPolicy != null && Object.hasOwnProperty.call(message, "booleanPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.encode(message.booleanPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.restoreDefault != null && Object.hasOwnProperty.call(message, "restoreDefault")) + $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.encode(message.restoreDefault, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.orgpolicy.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + message.constraint = reader.string(); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.decode(reader, reader.uint32()); + break; + } + case 6: { + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.decode(reader, reader.uint32()); + break; + } + case 7: { + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isString(message.constraint)) + return "constraint: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.verify(message.listPolicy); + if (error) + return "listPolicy." + error; + } + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify(message.booleanPolicy); + if (error) + return "booleanPolicy." + error; + } + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify(message.restoreDefault); + if (error) + return "restoreDefault." + error; + } + } + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.constraint != null) + message.constraint = String(object.constraint); + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.listPolicy != null) { + if (typeof object.listPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.listPolicy: object expected"); + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.fromObject(object.listPolicy); + } + if (object.booleanPolicy != null) { + if (typeof object.booleanPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.booleanPolicy: object expected"); + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.fromObject(object.booleanPolicy); + } + if (object.restoreDefault != null) { + if (typeof object.restoreDefault !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.restoreDefault: object expected"); + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.fromObject(object.restoreDefault); + } + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = 0; + object.constraint = ""; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + object.updateTime = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + object.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.toObject(message.listPolicy, options); + if (options.oneofs) + object.policyType = "listPolicy"; + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + object.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.toObject(message.booleanPolicy, options); + if (options.oneofs) + object.policyType = "booleanPolicy"; + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + object.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.toObject(message.restoreDefault, options); + if (options.oneofs) + object.policyType = "restoreDefault"; + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy"; + }; + + Policy.ListPolicy = (function() { + + /** + * Properties of a ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IListPolicy + * @property {Array.|null} [allowedValues] ListPolicy allowedValues + * @property {Array.|null} [deniedValues] ListPolicy deniedValues + * @property {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null} [allValues] ListPolicy allValues + * @property {string|null} [suggestedValue] ListPolicy suggestedValue + * @property {boolean|null} [inheritFromParent] ListPolicy inheritFromParent + */ + + /** + * Constructs a new ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a ListPolicy. + * @implements IListPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + */ + function ListPolicy(properties) { + this.allowedValues = []; + this.deniedValues = []; + 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]]; + } + + /** + * ListPolicy allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allowedValues = $util.emptyArray; + + /** + * ListPolicy deniedValues. + * @member {Array.} deniedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.deniedValues = $util.emptyArray; + + /** + * ListPolicy allValues. + * @member {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues} allValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allValues = 0; + + /** + * ListPolicy suggestedValue. + * @member {string} suggestedValue + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.suggestedValue = ""; + + /** + * ListPolicy inheritFromParent. + * @member {boolean} inheritFromParent + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.inheritFromParent = false; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy instance + */ + ListPolicy.create = function create(properties) { + return new ListPolicy(properties); + }; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + if (message.deniedValues != null && message.deniedValues.length) + for (var i = 0; i < message.deniedValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedValues[i]); + if (message.allValues != null && Object.hasOwnProperty.call(message, "allValues")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.allValues); + if (message.suggestedValue != null && Object.hasOwnProperty.call(message, "suggestedValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.suggestedValue); + if (message.inheritFromParent != null && Object.hasOwnProperty.call(message, "inheritFromParent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inheritFromParent); + return writer; + }; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.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.orgpolicy.v1.Policy.ListPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + case 2: { + if (!(message.deniedValues && message.deniedValues.length)) + message.deniedValues = []; + message.deniedValues.push(reader.string()); + break; + } + case 3: { + message.allValues = reader.int32(); + break; + } + case 4: { + message.suggestedValue = reader.string(); + break; + } + case 5: { + message.inheritFromParent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + if (message.deniedValues != null && message.hasOwnProperty("deniedValues")) { + if (!Array.isArray(message.deniedValues)) + return "deniedValues: array expected"; + for (var i = 0; i < message.deniedValues.length; ++i) + if (!$util.isString(message.deniedValues[i])) + return "deniedValues: string[] expected"; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + switch (message.allValues) { + default: + return "allValues: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + if (!$util.isString(message.suggestedValue)) + return "suggestedValue: string expected"; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + if (typeof message.inheritFromParent !== "boolean") + return "inheritFromParent: boolean expected"; + return null; + }; + + /** + * Creates a ListPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + */ + ListPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.ListPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.ListPolicy(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + if (object.deniedValues) { + if (!Array.isArray(object.deniedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.deniedValues: array expected"); + message.deniedValues = []; + for (var i = 0; i < object.deniedValues.length; ++i) + message.deniedValues[i] = String(object.deniedValues[i]); + } + switch (object.allValues) { + default: + if (typeof object.allValues === "number") { + message.allValues = object.allValues; + break; + } + break; + case "ALL_VALUES_UNSPECIFIED": + case 0: + message.allValues = 0; + break; + case "ALLOW": + case 1: + message.allValues = 1; + break; + case "DENY": + case 2: + message.allValues = 2; + break; + } + if (object.suggestedValue != null) + message.suggestedValue = String(object.suggestedValue); + if (object.inheritFromParent != null) + message.inheritFromParent = Boolean(object.inheritFromParent); + return message; + }; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.ListPolicy} message ListPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedValues = []; + object.deniedValues = []; + } + if (options.defaults) { + object.allValues = options.enums === String ? "ALL_VALUES_UNSPECIFIED" : 0; + object.suggestedValue = ""; + object.inheritFromParent = false; + } + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + if (message.deniedValues && message.deniedValues.length) { + object.deniedValues = []; + for (var j = 0; j < message.deniedValues.length; ++j) + object.deniedValues[j] = message.deniedValues[j]; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + object.allValues = options.enums === String ? $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] === undefined ? message.allValues : $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] : message.allValues; + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + object.suggestedValue = message.suggestedValue; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + object.inheritFromParent = message.inheritFromParent; + return object; + }; + + /** + * Converts this ListPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + * @returns {Object.} JSON object + */ + ListPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.ListPolicy"; + }; + + /** + * AllValues enum. + * @name google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues + * @enum {number} + * @property {number} ALL_VALUES_UNSPECIFIED=0 ALL_VALUES_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + ListPolicy.AllValues = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALL_VALUES_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return ListPolicy; + })(); + + Policy.BooleanPolicy = (function() { + + /** + * Properties of a BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IBooleanPolicy + * @property {boolean|null} [enforced] BooleanPolicy enforced + */ + + /** + * Constructs a new BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a BooleanPolicy. + * @implements IBooleanPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + */ + function BooleanPolicy(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]]; + } + + /** + * BooleanPolicy enforced. + * @member {boolean} enforced + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + */ + BooleanPolicy.prototype.enforced = false; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy instance + */ + BooleanPolicy.create = function create(properties) { + return new BooleanPolicy(properties); + }; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enforced != null && Object.hasOwnProperty.call(message, "enforced")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enforced); + return writer; + }; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.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.orgpolicy.v1.Policy.BooleanPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enforced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BooleanPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BooleanPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforced != null && message.hasOwnProperty("enforced")) + if (typeof message.enforced !== "boolean") + return "enforced: boolean expected"; + return null; + }; + + /** + * Creates a BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + */ + BooleanPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy(); + if (object.enforced != null) + message.enforced = Boolean(object.enforced); + return message; + }; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} message BooleanPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BooleanPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enforced = false; + if (message.enforced != null && message.hasOwnProperty("enforced")) + object.enforced = message.enforced; + return object; + }; + + /** + * Converts this BooleanPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + * @returns {Object.} JSON object + */ + BooleanPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BooleanPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BooleanPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.BooleanPolicy"; + }; + + return BooleanPolicy; + })(); + + Policy.RestoreDefault = (function() { + + /** + * Properties of a RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IRestoreDefault + */ + + /** + * Constructs a new RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a RestoreDefault. + * @implements IRestoreDefault + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + */ + function RestoreDefault(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]]; + } + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault instance + */ + RestoreDefault.create = function create(properties) { + return new RestoreDefault(properties); + }; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.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.orgpolicy.v1.Policy.RestoreDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDefault message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + */ + RestoreDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault) + return object; + return new $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault(); + }; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.RestoreDefault} message RestoreDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDefault.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestoreDefault to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @instance + * @returns {Object.} JSON object + */ + RestoreDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDefault + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.RestoreDefault"; + }; + + return RestoreDefault; + })(); + + return Policy; + })(); + + return v1; + })(); + + return orgpolicy; + })(); + + cloud.osconfig = (function() { + + /** + * Namespace osconfig. + * @memberof google.cloud + * @namespace + */ + var osconfig = {}; + + osconfig.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.osconfig + * @namespace + */ + var v1 = {}; + + v1.Inventory = (function() { + + /** + * Properties of an Inventory. + * @memberof google.cloud.osconfig.v1 + * @interface IInventory + * @property {string|null} [name] Inventory name + * @property {google.cloud.osconfig.v1.Inventory.IOsInfo|null} [osInfo] Inventory osInfo + * @property {Object.|null} [items] Inventory items + * @property {google.protobuf.ITimestamp|null} [updateTime] Inventory updateTime + */ + + /** + * Constructs a new Inventory. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents an Inventory. + * @implements IInventory + * @constructor + * @param {google.cloud.osconfig.v1.IInventory=} [properties] Properties to set + */ + function Inventory(properties) { + this.items = {}; + 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]]; + } + + /** + * Inventory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.name = ""; + + /** + * Inventory osInfo. + * @member {google.cloud.osconfig.v1.Inventory.IOsInfo|null|undefined} osInfo + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.osInfo = null; + + /** + * Inventory items. + * @member {Object.} items + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.items = $util.emptyObject; + + /** + * Inventory updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + */ + Inventory.prototype.updateTime = null; + + /** + * Creates a new Inventory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory} Inventory instance + */ + Inventory.create = function create(properties) { + return new Inventory(properties); + }; + + /** + * Encodes the specified Inventory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osInfo != null && Object.hasOwnProperty.call(message, "osInfo")) + $root.google.cloud.osconfig.v1.Inventory.OsInfo.encode(message.osInfo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + for (var keys = Object.keys(message.items), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.osconfig.v1.Inventory.Item.encode(message.items[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Inventory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.IInventory} message Inventory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Inventory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Inventory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.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.osconfig.v1.Inventory(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.name = reader.string(); + break; + } + case 1: { + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.items === $util.emptyObject) + message.items = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.osconfig.v1.Inventory.Item.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.items[key] = value; + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Inventory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Inventory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Inventory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Inventory.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.osInfo != null && message.hasOwnProperty("osInfo")) { + var error = $root.google.cloud.osconfig.v1.Inventory.OsInfo.verify(message.osInfo); + if (error) + return "osInfo." + error; + } + if (message.items != null && message.hasOwnProperty("items")) { + if (!$util.isObject(message.items)) + return "items: object expected"; + var key = Object.keys(message.items); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.Item.verify(message.items[key[i]]); + if (error) + return "items." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an Inventory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory} Inventory + */ + Inventory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory(); + if (object.name != null) + message.name = String(object.name); + if (object.osInfo != null) { + if (typeof object.osInfo !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.osInfo: object expected"); + message.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.fromObject(object.osInfo); + } + if (object.items) { + if (typeof object.items !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.items: object expected"); + message.items = {}; + for (var keys = Object.keys(object.items), i = 0; i < keys.length; ++i) { + if (typeof object.items[keys[i]] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.items: object expected"); + message.items[keys[i]] = $root.google.cloud.osconfig.v1.Inventory.Item.fromObject(object.items[keys[i]]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Inventory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {google.cloud.osconfig.v1.Inventory} message Inventory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Inventory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.items = {}; + if (options.defaults) { + object.osInfo = null; + object.name = ""; + object.updateTime = null; + } + if (message.osInfo != null && message.hasOwnProperty("osInfo")) + object.osInfo = $root.google.cloud.osconfig.v1.Inventory.OsInfo.toObject(message.osInfo, options); + var keys2; + if (message.items && (keys2 = Object.keys(message.items)).length) { + object.items = {}; + for (var j = 0; j < keys2.length; ++j) + object.items[keys2[j]] = $root.google.cloud.osconfig.v1.Inventory.Item.toObject(message.items[keys2[j]], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Inventory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory + * @instance + * @returns {Object.} JSON object + */ + Inventory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Inventory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Inventory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory"; + }; + + Inventory.OsInfo = (function() { + + /** + * Properties of an OsInfo. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IOsInfo + * @property {string|null} [hostname] OsInfo hostname + * @property {string|null} [longName] OsInfo longName + * @property {string|null} [shortName] OsInfo shortName + * @property {string|null} [version] OsInfo version + * @property {string|null} [architecture] OsInfo architecture + * @property {string|null} [kernelVersion] OsInfo kernelVersion + * @property {string|null} [kernelRelease] OsInfo kernelRelease + * @property {string|null} [osconfigAgentVersion] OsInfo osconfigAgentVersion + */ + + /** + * Constructs a new OsInfo. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents an OsInfo. + * @implements IOsInfo + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo=} [properties] Properties to set + */ + function OsInfo(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]]; + } + + /** + * OsInfo hostname. + * @member {string} hostname + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.hostname = ""; + + /** + * OsInfo longName. + * @member {string} longName + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.longName = ""; + + /** + * OsInfo shortName. + * @member {string} shortName + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.shortName = ""; + + /** + * OsInfo version. + * @member {string} version + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.version = ""; + + /** + * OsInfo architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.architecture = ""; + + /** + * OsInfo kernelVersion. + * @member {string} kernelVersion + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelVersion = ""; + + /** + * OsInfo kernelRelease. + * @member {string} kernelRelease + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.kernelRelease = ""; + + /** + * OsInfo osconfigAgentVersion. + * @member {string} osconfigAgentVersion + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + */ + OsInfo.prototype.osconfigAgentVersion = ""; + + /** + * Creates a new OsInfo instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo instance + */ + OsInfo.create = function create(properties) { + return new OsInfo(properties); + }; + + /** + * Encodes the specified OsInfo message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.longName != null && Object.hasOwnProperty.call(message, "longName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.longName); + if (message.shortName != null && Object.hasOwnProperty.call(message, "shortName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.shortName); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.architecture); + if (message.kernelVersion != null && Object.hasOwnProperty.call(message, "kernelVersion")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.kernelVersion); + if (message.kernelRelease != null && Object.hasOwnProperty.call(message, "kernelRelease")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.kernelRelease); + if (message.osconfigAgentVersion != null && Object.hasOwnProperty.call(message, "osconfigAgentVersion")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.osconfigAgentVersion); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.hostname); + return writer; + }; + + /** + * Encodes the specified OsInfo message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.OsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.IOsInfo} message OsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.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.osconfig.v1.Inventory.OsInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 9: { + message.hostname = reader.string(); + break; + } + case 2: { + message.longName = reader.string(); + break; + } + case 3: { + message.shortName = reader.string(); + break; + } + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.architecture = reader.string(); + break; + } + case 6: { + message.kernelVersion = reader.string(); + break; + } + case 7: { + message.kernelRelease = reader.string(); + break; + } + case 8: { + message.osconfigAgentVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsInfo message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.longName != null && message.hasOwnProperty("longName")) + if (!$util.isString(message.longName)) + return "longName: string expected"; + if (message.shortName != null && message.hasOwnProperty("shortName")) + if (!$util.isString(message.shortName)) + return "shortName: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + if (!$util.isString(message.kernelVersion)) + return "kernelVersion: string expected"; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + if (!$util.isString(message.kernelRelease)) + return "kernelRelease: string expected"; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + if (!$util.isString(message.osconfigAgentVersion)) + return "osconfigAgentVersion: string expected"; + return null; + }; + + /** + * Creates an OsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.OsInfo} OsInfo + */ + OsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.OsInfo) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.OsInfo(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.longName != null) + message.longName = String(object.longName); + if (object.shortName != null) + message.shortName = String(object.shortName); + if (object.version != null) + message.version = String(object.version); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.kernelVersion != null) + message.kernelVersion = String(object.kernelVersion); + if (object.kernelRelease != null) + message.kernelRelease = String(object.kernelRelease); + if (object.osconfigAgentVersion != null) + message.osconfigAgentVersion = String(object.osconfigAgentVersion); + return message; + }; + + /** + * Creates a plain object from an OsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {google.cloud.osconfig.v1.Inventory.OsInfo} message OsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.longName = ""; + object.shortName = ""; + object.version = ""; + object.architecture = ""; + object.kernelVersion = ""; + object.kernelRelease = ""; + object.osconfigAgentVersion = ""; + object.hostname = ""; + } + if (message.longName != null && message.hasOwnProperty("longName")) + object.longName = message.longName; + if (message.shortName != null && message.hasOwnProperty("shortName")) + object.shortName = message.shortName; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.kernelVersion != null && message.hasOwnProperty("kernelVersion")) + object.kernelVersion = message.kernelVersion; + if (message.kernelRelease != null && message.hasOwnProperty("kernelRelease")) + object.kernelRelease = message.kernelRelease; + if (message.osconfigAgentVersion != null && message.hasOwnProperty("osconfigAgentVersion")) + object.osconfigAgentVersion = message.osconfigAgentVersion; + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + return object; + }; + + /** + * Converts this OsInfo to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @instance + * @returns {Object.} JSON object + */ + OsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OsInfo + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.OsInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.OsInfo"; + }; + + return OsInfo; + })(); + + Inventory.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IItem + * @property {string|null} [id] Item id + * @property {google.cloud.osconfig.v1.Inventory.Item.OriginType|null} [originType] Item originType + * @property {google.protobuf.ITimestamp|null} [createTime] Item createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Item updateTime + * @property {google.cloud.osconfig.v1.Inventory.Item.Type|null} [type] Item type + * @property {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null} [installedPackage] Item installedPackage + * @property {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null} [availablePackage] Item availablePackage + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IItem=} [properties] Properties to set + */ + function Item(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]]; + } + + /** + * Item id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.id = ""; + + /** + * Item originType. + * @member {google.cloud.osconfig.v1.Inventory.Item.OriginType} originType + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.originType = 0; + + /** + * Item createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.createTime = null; + + /** + * Item updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.updateTime = null; + + /** + * Item type. + * @member {google.cloud.osconfig.v1.Inventory.Item.Type} type + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.type = 0; + + /** + * Item installedPackage. + * @member {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null|undefined} installedPackage + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.installedPackage = null; + + /** + * Item availablePackage. + * @member {google.cloud.osconfig.v1.Inventory.ISoftwarePackage|null|undefined} availablePackage + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Item.prototype.availablePackage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Item details. + * @member {"installedPackage"|"availablePackage"|undefined} details + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + */ + Object.defineProperty(Item.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["installedPackage", "availablePackage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.originType != null && Object.hasOwnProperty.call(message, "originType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.originType); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.installedPackage != null && Object.hasOwnProperty.call(message, "installedPackage")) + $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.encode(message.installedPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.availablePackage != null && Object.hasOwnProperty.call(message, "availablePackage")) + $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.encode(message.availablePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.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.osconfig.v1.Inventory.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.originType = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + } + case 7: { + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.originType != null && message.hasOwnProperty("originType")) + switch (message.originType) { + default: + return "originType: enum value expected"; + case 0: + case 1: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify(message.installedPackage); + if (error) + return "installedPackage." + error; + } + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify(message.availablePackage); + if (error) + return "availablePackage." + error; + } + } + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.Item) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.Item(); + if (object.id != null) + message.id = String(object.id); + switch (object.originType) { + default: + if (typeof object.originType === "number") { + message.originType = object.originType; + break; + } + break; + case "ORIGIN_TYPE_UNSPECIFIED": + case 0: + message.originType = 0; + break; + case "INVENTORY_REPORT": + case 1: + message.originType = 1; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "INSTALLED_PACKAGE": + case 1: + message.type = 1; + break; + case "AVAILABLE_PACKAGE": + case 2: + message.type = 2; + break; + } + if (object.installedPackage != null) { + if (typeof object.installedPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.installedPackage: object expected"); + message.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.fromObject(object.installedPackage); + } + if (object.availablePackage != null) { + if (typeof object.availablePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.Item.availablePackage: object expected"); + message.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.fromObject(object.availablePackage); + } + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {google.cloud.osconfig.v1.Inventory.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.originType = options.enums === String ? "ORIGIN_TYPE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.originType != null && message.hasOwnProperty("originType")) + object.originType = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] === undefined ? message.originType : $root.google.cloud.osconfig.v1.Inventory.Item.OriginType[message.originType] : message.originType; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] === undefined ? message.type : $root.google.cloud.osconfig.v1.Inventory.Item.Type[message.type] : message.type; + if (message.installedPackage != null && message.hasOwnProperty("installedPackage")) { + object.installedPackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.installedPackage, options); + if (options.oneofs) + object.details = "installedPackage"; + } + if (message.availablePackage != null && message.hasOwnProperty("availablePackage")) { + object.availablePackage = $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage.toObject(message.availablePackage, options); + if (options.oneofs) + object.details = "availablePackage"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Item + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.Item + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Item.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.Item"; + }; + + /** + * OriginType enum. + * @name google.cloud.osconfig.v1.Inventory.Item.OriginType + * @enum {number} + * @property {number} ORIGIN_TYPE_UNSPECIFIED=0 ORIGIN_TYPE_UNSPECIFIED value + * @property {number} INVENTORY_REPORT=1 INVENTORY_REPORT value + */ + Item.OriginType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGIN_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INVENTORY_REPORT"] = 1; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.osconfig.v1.Inventory.Item.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} INSTALLED_PACKAGE=1 INSTALLED_PACKAGE value + * @property {number} AVAILABLE_PACKAGE=2 AVAILABLE_PACKAGE value + */ + Item.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INSTALLED_PACKAGE"] = 1; + values[valuesById[2] = "AVAILABLE_PACKAGE"] = 2; + return values; + })(); + + return Item; + })(); + + Inventory.SoftwarePackage = (function() { + + /** + * Properties of a SoftwarePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface ISoftwarePackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [yumPackage] SoftwarePackage yumPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [aptPackage] SoftwarePackage aptPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [zypperPackage] SoftwarePackage zypperPackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [googetPackage] SoftwarePackage googetPackage + * @property {google.cloud.osconfig.v1.Inventory.IZypperPatch|null} [zypperPatch] SoftwarePackage zypperPatch + * @property {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null} [wuaPackage] SoftwarePackage wuaPackage + * @property {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null} [qfePackage] SoftwarePackage qfePackage + * @property {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null} [cosPackage] SoftwarePackage cosPackage + * @property {google.cloud.osconfig.v1.Inventory.IWindowsApplication|null} [windowsApplication] SoftwarePackage windowsApplication + */ + + /** + * Constructs a new SoftwarePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a SoftwarePackage. + * @implements ISoftwarePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage=} [properties] Properties to set + */ + function SoftwarePackage(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]]; + } + + /** + * SoftwarePackage yumPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} yumPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.yumPackage = null; + + /** + * SoftwarePackage aptPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} aptPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.aptPackage = null; + + /** + * SoftwarePackage zypperPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} zypperPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPackage = null; + + /** + * SoftwarePackage googetPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} googetPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.googetPackage = null; + + /** + * SoftwarePackage zypperPatch. + * @member {google.cloud.osconfig.v1.Inventory.IZypperPatch|null|undefined} zypperPatch + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.zypperPatch = null; + + /** + * SoftwarePackage wuaPackage. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage|null|undefined} wuaPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.wuaPackage = null; + + /** + * SoftwarePackage qfePackage. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage|null|undefined} qfePackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.qfePackage = null; + + /** + * SoftwarePackage cosPackage. + * @member {google.cloud.osconfig.v1.Inventory.IVersionedPackage|null|undefined} cosPackage + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.cosPackage = null; + + /** + * SoftwarePackage windowsApplication. + * @member {google.cloud.osconfig.v1.Inventory.IWindowsApplication|null|undefined} windowsApplication + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + SoftwarePackage.prototype.windowsApplication = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SoftwarePackage details. + * @member {"yumPackage"|"aptPackage"|"zypperPackage"|"googetPackage"|"zypperPatch"|"wuaPackage"|"qfePackage"|"cosPackage"|"windowsApplication"|undefined} details + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + */ + Object.defineProperty(SoftwarePackage.prototype, "details", { + get: $util.oneOfGetter($oneOfFields = ["yumPackage", "aptPackage", "zypperPackage", "googetPackage", "zypperPatch", "wuaPackage", "qfePackage", "cosPackage", "windowsApplication"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SoftwarePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage instance + */ + SoftwarePackage.create = function create(properties) { + return new SoftwarePackage(properties); + }; + + /** + * Encodes the specified SoftwarePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.yumPackage != null && Object.hasOwnProperty.call(message, "yumPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.yumPackage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aptPackage != null && Object.hasOwnProperty.call(message, "aptPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.aptPackage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.zypperPackage != null && Object.hasOwnProperty.call(message, "zypperPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.zypperPackage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googetPackage != null && Object.hasOwnProperty.call(message, "googetPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.googetPackage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.zypperPatch != null && Object.hasOwnProperty.call(message, "zypperPatch")) + $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.encode(message.zypperPatch, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.wuaPackage != null && Object.hasOwnProperty.call(message, "wuaPackage")) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.encode(message.wuaPackage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.qfePackage != null && Object.hasOwnProperty.call(message, "qfePackage")) + $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.encode(message.qfePackage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.cosPackage != null && Object.hasOwnProperty.call(message, "cosPackage")) + $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.encode(message.cosPackage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.windowsApplication != null && Object.hasOwnProperty.call(message, "windowsApplication")) + $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.encode(message.windowsApplication, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SoftwarePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.SoftwarePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.ISoftwarePackage} message SoftwarePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SoftwarePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.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.osconfig.v1.Inventory.SoftwarePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 2: { + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 3: { + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 4: { + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 5: { + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.decode(reader, reader.uint32()); + break; + } + case 6: { + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.decode(reader, reader.uint32()); + break; + } + case 7: { + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.decode(reader, reader.uint32()); + break; + } + case 8: { + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.decode(reader, reader.uint32()); + break; + } + case 9: { + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SoftwarePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SoftwarePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SoftwarePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SoftwarePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.yumPackage); + if (error) + return "yumPackage." + error; + } + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.aptPackage); + if (error) + return "aptPackage." + error; + } + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.zypperPackage); + if (error) + return "zypperPackage." + error; + } + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.googetPackage); + if (error) + return "googetPackage." + error; + } + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.verify(message.zypperPatch); + if (error) + return "zypperPatch." + error; + } + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify(message.wuaPackage); + if (error) + return "wuaPackage." + error; + } + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify(message.qfePackage); + if (error) + return "qfePackage." + error; + } + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.verify(message.cosPackage); + if (error) + return "cosPackage." + error; + } + } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.verify(message.windowsApplication); + if (error) + return "windowsApplication." + error; + } + } + return null; + }; + + /** + * Creates a SoftwarePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.SoftwarePackage} SoftwarePackage + */ + SoftwarePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.SoftwarePackage(); + if (object.yumPackage != null) { + if (typeof object.yumPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.yumPackage: object expected"); + message.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.yumPackage); + } + if (object.aptPackage != null) { + if (typeof object.aptPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.aptPackage: object expected"); + message.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.aptPackage); + } + if (object.zypperPackage != null) { + if (typeof object.zypperPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.zypperPackage: object expected"); + message.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.zypperPackage); + } + if (object.googetPackage != null) { + if (typeof object.googetPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.googetPackage: object expected"); + message.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.googetPackage); + } + if (object.zypperPatch != null) { + if (typeof object.zypperPatch !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.zypperPatch: object expected"); + message.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.fromObject(object.zypperPatch); + } + if (object.wuaPackage != null) { + if (typeof object.wuaPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.wuaPackage: object expected"); + message.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.fromObject(object.wuaPackage); + } + if (object.qfePackage != null) { + if (typeof object.qfePackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.qfePackage: object expected"); + message.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.fromObject(object.qfePackage); + } + if (object.cosPackage != null) { + if (typeof object.cosPackage !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.cosPackage: object expected"); + message.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.fromObject(object.cosPackage); + } + if (object.windowsApplication != null) { + if (typeof object.windowsApplication !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.SoftwarePackage.windowsApplication: object expected"); + message.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.fromObject(object.windowsApplication); + } + return message; + }; + + /** + * Creates a plain object from a SoftwarePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.SoftwarePackage} message SoftwarePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SoftwarePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.yumPackage != null && message.hasOwnProperty("yumPackage")) { + object.yumPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.yumPackage, options); + if (options.oneofs) + object.details = "yumPackage"; + } + if (message.aptPackage != null && message.hasOwnProperty("aptPackage")) { + object.aptPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.aptPackage, options); + if (options.oneofs) + object.details = "aptPackage"; + } + if (message.zypperPackage != null && message.hasOwnProperty("zypperPackage")) { + object.zypperPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.zypperPackage, options); + if (options.oneofs) + object.details = "zypperPackage"; + } + if (message.googetPackage != null && message.hasOwnProperty("googetPackage")) { + object.googetPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.googetPackage, options); + if (options.oneofs) + object.details = "googetPackage"; + } + if (message.zypperPatch != null && message.hasOwnProperty("zypperPatch")) { + object.zypperPatch = $root.google.cloud.osconfig.v1.Inventory.ZypperPatch.toObject(message.zypperPatch, options); + if (options.oneofs) + object.details = "zypperPatch"; + } + if (message.wuaPackage != null && message.hasOwnProperty("wuaPackage")) { + object.wuaPackage = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.toObject(message.wuaPackage, options); + if (options.oneofs) + object.details = "wuaPackage"; + } + if (message.qfePackage != null && message.hasOwnProperty("qfePackage")) { + object.qfePackage = $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.toObject(message.qfePackage, options); + if (options.oneofs) + object.details = "qfePackage"; + } + if (message.cosPackage != null && message.hasOwnProperty("cosPackage")) { + object.cosPackage = $root.google.cloud.osconfig.v1.Inventory.VersionedPackage.toObject(message.cosPackage, options); + if (options.oneofs) + object.details = "cosPackage"; + } + if (message.windowsApplication != null && message.hasOwnProperty("windowsApplication")) { + object.windowsApplication = $root.google.cloud.osconfig.v1.Inventory.WindowsApplication.toObject(message.windowsApplication, options); + if (options.oneofs) + object.details = "windowsApplication"; + } + return object; + }; + + /** + * Converts this SoftwarePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @instance + * @returns {Object.} JSON object + */ + SoftwarePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SoftwarePackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.SoftwarePackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SoftwarePackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.SoftwarePackage"; + }; + + return SoftwarePackage; + })(); + + Inventory.VersionedPackage = (function() { + + /** + * Properties of a VersionedPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IVersionedPackage + * @property {string|null} [packageName] VersionedPackage packageName + * @property {string|null} [architecture] VersionedPackage architecture + * @property {string|null} [version] VersionedPackage version + */ + + /** + * Constructs a new VersionedPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a VersionedPackage. + * @implements IVersionedPackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage=} [properties] Properties to set + */ + function VersionedPackage(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]]; + } + + /** + * VersionedPackage packageName. + * @member {string} packageName + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.packageName = ""; + + /** + * VersionedPackage architecture. + * @member {string} architecture + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.architecture = ""; + + /** + * VersionedPackage version. + * @member {string} version + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + */ + VersionedPackage.prototype.version = ""; + + /** + * Creates a new VersionedPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage instance + */ + VersionedPackage.create = function create(properties) { + return new VersionedPackage(properties); + }; + + /** + * Encodes the specified VersionedPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.architecture); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.packageName != null && Object.hasOwnProperty.call(message, "packageName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.packageName); + return writer; + }; + + /** + * Encodes the specified VersionedPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.VersionedPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IVersionedPackage} message VersionedPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VersionedPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.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.osconfig.v1.Inventory.VersionedPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.packageName = reader.string(); + break; + } + case 2: { + message.architecture = reader.string(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VersionedPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VersionedPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VersionedPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VersionedPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.packageName != null && message.hasOwnProperty("packageName")) + if (!$util.isString(message.packageName)) + return "packageName: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + if (!$util.isString(message.architecture)) + return "architecture: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + return null; + }; + + /** + * Creates a VersionedPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.VersionedPackage} VersionedPackage + */ + VersionedPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.VersionedPackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.VersionedPackage(); + if (object.packageName != null) + message.packageName = String(object.packageName); + if (object.architecture != null) + message.architecture = String(object.architecture); + if (object.version != null) + message.version = String(object.version); + return message; + }; + + /** + * Creates a plain object from a VersionedPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.VersionedPackage} message VersionedPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VersionedPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.architecture = ""; + object.version = ""; + object.packageName = ""; + } + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = message.architecture; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.packageName != null && message.hasOwnProperty("packageName")) + object.packageName = message.packageName; + return object; + }; + + /** + * Converts this VersionedPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @instance + * @returns {Object.} JSON object + */ + VersionedPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VersionedPackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.VersionedPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VersionedPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.VersionedPackage"; + }; + + return VersionedPackage; + })(); + + Inventory.ZypperPatch = (function() { + + /** + * Properties of a ZypperPatch. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IZypperPatch + * @property {string|null} [patchName] ZypperPatch patchName + * @property {string|null} [category] ZypperPatch category + * @property {string|null} [severity] ZypperPatch severity + * @property {string|null} [summary] ZypperPatch summary + */ + + /** + * Constructs a new ZypperPatch. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a ZypperPatch. + * @implements IZypperPatch + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + */ + function ZypperPatch(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]]; + } + + /** + * ZypperPatch patchName. + * @member {string} patchName + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.patchName = ""; + + /** + * ZypperPatch category. + * @member {string} category + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.category = ""; + + /** + * ZypperPatch severity. + * @member {string} severity + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.severity = ""; + + /** + * ZypperPatch summary. + * @member {string} summary + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + */ + ZypperPatch.prototype.summary = ""; + + /** + * Creates a new ZypperPatch instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch instance + */ + ZypperPatch.create = function create(properties) { + return new ZypperPatch(properties); + }; + + /** + * Encodes the specified ZypperPatch message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperPatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.category); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.severity); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); + if (message.patchName != null && Object.hasOwnProperty.call(message, "patchName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.patchName); + return writer; + }; + + /** + * Encodes the specified ZypperPatch message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.ZypperPatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.IZypperPatch} message ZypperPatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ZypperPatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperPatch.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.osconfig.v1.Inventory.ZypperPatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.patchName = reader.string(); + break; + } + case 2: { + message.category = reader.string(); + break; + } + case 3: { + message.severity = reader.string(); + break; + } + case 4: { + message.summary = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ZypperPatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ZypperPatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ZypperPatch message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ZypperPatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.patchName != null && message.hasOwnProperty("patchName")) + if (!$util.isString(message.patchName)) + return "patchName: string expected"; + if (message.category != null && message.hasOwnProperty("category")) + if (!$util.isString(message.category)) + return "category: string expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + if (!$util.isString(message.severity)) + return "severity: string expected"; + if (message.summary != null && message.hasOwnProperty("summary")) + if (!$util.isString(message.summary)) + return "summary: string expected"; + return null; + }; + + /** + * Creates a ZypperPatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.ZypperPatch} ZypperPatch + */ + ZypperPatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.ZypperPatch) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.ZypperPatch(); + if (object.patchName != null) + message.patchName = String(object.patchName); + if (object.category != null) + message.category = String(object.category); + if (object.severity != null) + message.severity = String(object.severity); + if (object.summary != null) + message.summary = String(object.summary); + return message; + }; + + /** + * Creates a plain object from a ZypperPatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {google.cloud.osconfig.v1.Inventory.ZypperPatch} message ZypperPatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ZypperPatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = ""; + object.severity = ""; + object.summary = ""; + object.patchName = ""; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = message.category; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = message.severity; + if (message.summary != null && message.hasOwnProperty("summary")) + object.summary = message.summary; + if (message.patchName != null && message.hasOwnProperty("patchName")) + object.patchName = message.patchName; + return object; + }; + + /** + * Converts this ZypperPatch to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @instance + * @returns {Object.} JSON object + */ + ZypperPatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ZypperPatch + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.ZypperPatch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ZypperPatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.ZypperPatch"; + }; + + return ZypperPatch; + })(); + + Inventory.WindowsUpdatePackage = (function() { + + /** + * Properties of a WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsUpdatePackage + * @property {string|null} [title] WindowsUpdatePackage title + * @property {string|null} [description] WindowsUpdatePackage description + * @property {Array.|null} [categories] WindowsUpdatePackage categories + * @property {Array.|null} [kbArticleIds] WindowsUpdatePackage kbArticleIds + * @property {string|null} [supportUrl] WindowsUpdatePackage supportUrl + * @property {Array.|null} [moreInfoUrls] WindowsUpdatePackage moreInfoUrls + * @property {string|null} [updateId] WindowsUpdatePackage updateId + * @property {number|null} [revisionNumber] WindowsUpdatePackage revisionNumber + * @property {google.protobuf.ITimestamp|null} [lastDeploymentChangeTime] WindowsUpdatePackage lastDeploymentChangeTime + */ + + /** + * Constructs a new WindowsUpdatePackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsUpdatePackage. + * @implements IWindowsUpdatePackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + */ + function WindowsUpdatePackage(properties) { + this.categories = []; + this.kbArticleIds = []; + this.moreInfoUrls = []; + 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]]; + } + + /** + * WindowsUpdatePackage title. + * @member {string} title + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.title = ""; + + /** + * WindowsUpdatePackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.description = ""; + + /** + * WindowsUpdatePackage categories. + * @member {Array.} categories + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.categories = $util.emptyArray; + + /** + * WindowsUpdatePackage kbArticleIds. + * @member {Array.} kbArticleIds + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.kbArticleIds = $util.emptyArray; + + /** + * WindowsUpdatePackage supportUrl. + * @member {string} supportUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.supportUrl = ""; + + /** + * WindowsUpdatePackage moreInfoUrls. + * @member {Array.} moreInfoUrls + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.moreInfoUrls = $util.emptyArray; + + /** + * WindowsUpdatePackage updateId. + * @member {string} updateId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.updateId = ""; + + /** + * WindowsUpdatePackage revisionNumber. + * @member {number} revisionNumber + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.revisionNumber = 0; + + /** + * WindowsUpdatePackage lastDeploymentChangeTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastDeploymentChangeTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + */ + WindowsUpdatePackage.prototype.lastDeploymentChangeTime = null; + + /** + * Creates a new WindowsUpdatePackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage instance + */ + WindowsUpdatePackage.create = function create(properties) { + return new WindowsUpdatePackage(properties); + }; + + /** + * Encodes the specified WindowsUpdatePackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdatePackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.categories != null && message.categories.length) + for (var i = 0; i < message.categories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.encode(message.categories[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.kbArticleIds != null && message.kbArticleIds.length) + for (var i = 0; i < message.kbArticleIds.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kbArticleIds[i]); + if (message.moreInfoUrls != null && message.moreInfoUrls.length) + for (var i = 0; i < message.moreInfoUrls.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.moreInfoUrls[i]); + if (message.updateId != null && Object.hasOwnProperty.call(message, "updateId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.updateId); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.revisionNumber); + if (message.lastDeploymentChangeTime != null && Object.hasOwnProperty.call(message, "lastDeploymentChangeTime")) + $root.google.protobuf.Timestamp.encode(message.lastDeploymentChangeTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.supportUrl != null && Object.hasOwnProperty.call(message, "supportUrl")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.supportUrl); + return writer; + }; + + /** + * Encodes the specified WindowsUpdatePackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsUpdatePackage} message WindowsUpdatePackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdatePackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdatePackage.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.osconfig.v1.Inventory.WindowsUpdatePackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (!(message.categories && message.categories.length)) + message.categories = []; + message.categories.push($root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.kbArticleIds && message.kbArticleIds.length)) + message.kbArticleIds = []; + message.kbArticleIds.push(reader.string()); + break; + } + case 11: { + message.supportUrl = reader.string(); + break; + } + case 5: { + if (!(message.moreInfoUrls && message.moreInfoUrls.length)) + message.moreInfoUrls = []; + message.moreInfoUrls.push(reader.string()); + break; + } + case 6: { + message.updateId = reader.string(); + break; + } + case 7: { + message.revisionNumber = reader.int32(); + break; + } + case 10: { + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdatePackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdatePackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdatePackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdatePackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.categories != null && message.hasOwnProperty("categories")) { + if (!Array.isArray(message.categories)) + return "categories: array expected"; + for (var i = 0; i < message.categories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify(message.categories[i]); + if (error) + return "categories." + error; + } + } + if (message.kbArticleIds != null && message.hasOwnProperty("kbArticleIds")) { + if (!Array.isArray(message.kbArticleIds)) + return "kbArticleIds: array expected"; + for (var i = 0; i < message.kbArticleIds.length; ++i) + if (!$util.isString(message.kbArticleIds[i])) + return "kbArticleIds: string[] expected"; + } + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + if (!$util.isString(message.supportUrl)) + return "supportUrl: string expected"; + if (message.moreInfoUrls != null && message.hasOwnProperty("moreInfoUrls")) { + if (!Array.isArray(message.moreInfoUrls)) + return "moreInfoUrls: array expected"; + for (var i = 0; i < message.moreInfoUrls.length; ++i) + if (!$util.isString(message.moreInfoUrls[i])) + return "moreInfoUrls: string[] expected"; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + if (!$util.isString(message.updateId)) + return "updateId: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber)) + return "revisionNumber: integer expected"; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastDeploymentChangeTime); + if (error) + return "lastDeploymentChangeTime." + error; + } + return null; + }; + + /** + * Creates a WindowsUpdatePackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} WindowsUpdatePackage + */ + WindowsUpdatePackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.categories) { + if (!Array.isArray(object.categories)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: array expected"); + message.categories = []; + for (var i = 0; i < object.categories.length; ++i) { + if (typeof object.categories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.categories: object expected"); + message.categories[i] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.fromObject(object.categories[i]); + } + } + if (object.kbArticleIds) { + if (!Array.isArray(object.kbArticleIds)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.kbArticleIds: array expected"); + message.kbArticleIds = []; + for (var i = 0; i < object.kbArticleIds.length; ++i) + message.kbArticleIds[i] = String(object.kbArticleIds[i]); + } + if (object.supportUrl != null) + message.supportUrl = String(object.supportUrl); + if (object.moreInfoUrls) { + if (!Array.isArray(object.moreInfoUrls)) + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.moreInfoUrls: array expected"); + message.moreInfoUrls = []; + for (var i = 0; i < object.moreInfoUrls.length; ++i) + message.moreInfoUrls[i] = String(object.moreInfoUrls[i]); + } + if (object.updateId != null) + message.updateId = String(object.updateId); + if (object.revisionNumber != null) + message.revisionNumber = object.revisionNumber | 0; + if (object.lastDeploymentChangeTime != null) { + if (typeof object.lastDeploymentChangeTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.lastDeploymentChangeTime: object expected"); + message.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.fromObject(object.lastDeploymentChangeTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsUpdatePackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} message WindowsUpdatePackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdatePackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.categories = []; + object.kbArticleIds = []; + object.moreInfoUrls = []; + } + if (options.defaults) { + object.title = ""; + object.description = ""; + object.updateId = ""; + object.revisionNumber = 0; + object.lastDeploymentChangeTime = null; + object.supportUrl = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.categories && message.categories.length) { + object.categories = []; + for (var j = 0; j < message.categories.length; ++j) + object.categories[j] = $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.toObject(message.categories[j], options); + } + if (message.kbArticleIds && message.kbArticleIds.length) { + object.kbArticleIds = []; + for (var j = 0; j < message.kbArticleIds.length; ++j) + object.kbArticleIds[j] = message.kbArticleIds[j]; + } + if (message.moreInfoUrls && message.moreInfoUrls.length) { + object.moreInfoUrls = []; + for (var j = 0; j < message.moreInfoUrls.length; ++j) + object.moreInfoUrls[j] = message.moreInfoUrls[j]; + } + if (message.updateId != null && message.hasOwnProperty("updateId")) + object.updateId = message.updateId; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + object.revisionNumber = message.revisionNumber; + if (message.lastDeploymentChangeTime != null && message.hasOwnProperty("lastDeploymentChangeTime")) + object.lastDeploymentChangeTime = $root.google.protobuf.Timestamp.toObject(message.lastDeploymentChangeTime, options); + if (message.supportUrl != null && message.hasOwnProperty("supportUrl")) + object.supportUrl = message.supportUrl; + return object; + }; + + /** + * Converts this WindowsUpdatePackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdatePackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsUpdatePackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdatePackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage"; + }; + + WindowsUpdatePackage.WindowsUpdateCategory = (function() { + + /** + * Properties of a WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @interface IWindowsUpdateCategory + * @property {string|null} [id] WindowsUpdateCategory id + * @property {string|null} [name] WindowsUpdateCategory name + */ + + /** + * Constructs a new WindowsUpdateCategory. + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + * @classdesc Represents a WindowsUpdateCategory. + * @implements IWindowsUpdateCategory + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + */ + function WindowsUpdateCategory(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]]; + } + + /** + * WindowsUpdateCategory id. + * @member {string} id + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.id = ""; + + /** + * WindowsUpdateCategory name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + */ + WindowsUpdateCategory.prototype.name = ""; + + /** + * Creates a new WindowsUpdateCategory instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory instance + */ + WindowsUpdateCategory.create = function create(properties) { + return new WindowsUpdateCategory(properties); + }; + + /** + * Encodes the specified WindowsUpdateCategory message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified WindowsUpdateCategory message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.IWindowsUpdateCategory} message WindowsUpdateCategory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsUpdateCategory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsUpdateCategory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsUpdateCategory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsUpdateCategory message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsUpdateCategory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a WindowsUpdateCategory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} WindowsUpdateCategory + */ + WindowsUpdateCategory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a WindowsUpdateCategory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} message WindowsUpdateCategory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsUpdateCategory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.name = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this WindowsUpdateCategory to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @instance + * @returns {Object.} JSON object + */ + WindowsUpdateCategory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsUpdateCategory + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsUpdateCategory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory"; + }; + + return WindowsUpdateCategory; + })(); + + return WindowsUpdatePackage; + })(); + + Inventory.WindowsQuickFixEngineeringPackage = (function() { + + /** + * Properties of a WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsQuickFixEngineeringPackage + * @property {string|null} [caption] WindowsQuickFixEngineeringPackage caption + * @property {string|null} [description] WindowsQuickFixEngineeringPackage description + * @property {string|null} [hotFixId] WindowsQuickFixEngineeringPackage hotFixId + * @property {google.protobuf.ITimestamp|null} [installTime] WindowsQuickFixEngineeringPackage installTime + */ + + /** + * Constructs a new WindowsQuickFixEngineeringPackage. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsQuickFixEngineeringPackage. + * @implements IWindowsQuickFixEngineeringPackage + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + */ + function WindowsQuickFixEngineeringPackage(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]]; + } + + /** + * WindowsQuickFixEngineeringPackage caption. + * @member {string} caption + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.caption = ""; + + /** + * WindowsQuickFixEngineeringPackage description. + * @member {string} description + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.description = ""; + + /** + * WindowsQuickFixEngineeringPackage hotFixId. + * @member {string} hotFixId + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.hotFixId = ""; + + /** + * WindowsQuickFixEngineeringPackage installTime. + * @member {google.protobuf.ITimestamp|null|undefined} installTime + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + */ + WindowsQuickFixEngineeringPackage.prototype.installTime = null; + + /** + * Creates a new WindowsQuickFixEngineeringPackage instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage instance + */ + WindowsQuickFixEngineeringPackage.create = function create(properties) { + return new WindowsQuickFixEngineeringPackage(properties); + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.caption); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.hotFixId != null && Object.hasOwnProperty.call(message, "hotFixId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hotFixId); + if (message.installTime != null && Object.hasOwnProperty.call(message, "installTime")) + $root.google.protobuf.Timestamp.encode(message.installTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WindowsQuickFixEngineeringPackage message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsQuickFixEngineeringPackage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.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.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.caption = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.hotFixId = reader.string(); + break; + } + case 5: { + message.installTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsQuickFixEngineeringPackage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsQuickFixEngineeringPackage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsQuickFixEngineeringPackage message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsQuickFixEngineeringPackage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + if (!$util.isString(message.hotFixId)) + return "hotFixId: string expected"; + if (message.installTime != null && message.hasOwnProperty("installTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.installTime); + if (error) + return "installTime." + error; + } + return null; + }; + + /** + * Creates a WindowsQuickFixEngineeringPackage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} WindowsQuickFixEngineeringPackage + */ + WindowsQuickFixEngineeringPackage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage(); + if (object.caption != null) + message.caption = String(object.caption); + if (object.description != null) + message.description = String(object.description); + if (object.hotFixId != null) + message.hotFixId = String(object.hotFixId); + if (object.installTime != null) { + if (typeof object.installTime !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage.installTime: object expected"); + message.installTime = $root.google.protobuf.Timestamp.fromObject(object.installTime); + } + return message; + }; + + /** + * Creates a plain object from a WindowsQuickFixEngineeringPackage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage} message WindowsQuickFixEngineeringPackage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsQuickFixEngineeringPackage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.caption = ""; + object.description = ""; + object.hotFixId = ""; + object.installTime = null; + } + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.hotFixId != null && message.hasOwnProperty("hotFixId")) + object.hotFixId = message.hotFixId; + if (message.installTime != null && message.hasOwnProperty("installTime")) + object.installTime = $root.google.protobuf.Timestamp.toObject(message.installTime, options); + return object; + }; + + /** + * Converts this WindowsQuickFixEngineeringPackage to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @instance + * @returns {Object.} JSON object + */ + WindowsQuickFixEngineeringPackage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsQuickFixEngineeringPackage + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsQuickFixEngineeringPackage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsQuickFixEngineeringPackage"; + }; + + return WindowsQuickFixEngineeringPackage; + })(); + + Inventory.WindowsApplication = (function() { + + /** + * Properties of a WindowsApplication. + * @memberof google.cloud.osconfig.v1.Inventory + * @interface IWindowsApplication + * @property {string|null} [displayName] WindowsApplication displayName + * @property {string|null} [displayVersion] WindowsApplication displayVersion + * @property {string|null} [publisher] WindowsApplication publisher + * @property {google.type.IDate|null} [installDate] WindowsApplication installDate + * @property {string|null} [helpLink] WindowsApplication helpLink + */ + + /** + * Constructs a new WindowsApplication. + * @memberof google.cloud.osconfig.v1.Inventory + * @classdesc Represents a WindowsApplication. + * @implements IWindowsApplication + * @constructor + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication=} [properties] Properties to set + */ + function WindowsApplication(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]]; + } + + /** + * WindowsApplication displayName. + * @member {string} displayName + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayName = ""; + + /** + * WindowsApplication displayVersion. + * @member {string} displayVersion + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.displayVersion = ""; + + /** + * WindowsApplication publisher. + * @member {string} publisher + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.publisher = ""; + + /** + * WindowsApplication installDate. + * @member {google.type.IDate|null|undefined} installDate + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.installDate = null; + + /** + * WindowsApplication helpLink. + * @member {string} helpLink + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + */ + WindowsApplication.prototype.helpLink = ""; + + /** + * Creates a new WindowsApplication instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication instance + */ + WindowsApplication.create = function create(properties) { + return new WindowsApplication(properties); + }; + + /** + * Encodes the specified WindowsApplication message. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.displayVersion != null && Object.hasOwnProperty.call(message, "displayVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayVersion); + if (message.publisher != null && Object.hasOwnProperty.call(message, "publisher")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.publisher); + if (message.installDate != null && Object.hasOwnProperty.call(message, "installDate")) + $root.google.type.Date.encode(message.installDate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.helpLink != null && Object.hasOwnProperty.call(message, "helpLink")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.helpLink); + return writer; + }; + + /** + * Encodes the specified WindowsApplication message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.Inventory.WindowsApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.IWindowsApplication} message WindowsApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WindowsApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.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.osconfig.v1.Inventory.WindowsApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.displayName = reader.string(); + break; + } + case 2: { + message.displayVersion = reader.string(); + break; + } + case 3: { + message.publisher = reader.string(); + break; + } + case 4: { + message.installDate = $root.google.type.Date.decode(reader, reader.uint32()); + break; + } + case 5: { + message.helpLink = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WindowsApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WindowsApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WindowsApplication message. + * @function verify + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WindowsApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + if (!$util.isString(message.displayVersion)) + return "displayVersion: string expected"; + if (message.publisher != null && message.hasOwnProperty("publisher")) + if (!$util.isString(message.publisher)) + return "publisher: string expected"; + if (message.installDate != null && message.hasOwnProperty("installDate")) { + var error = $root.google.type.Date.verify(message.installDate); + if (error) + return "installDate." + error; + } + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + if (!$util.isString(message.helpLink)) + return "helpLink: string expected"; + return null; + }; + + /** + * Creates a WindowsApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.Inventory.WindowsApplication} WindowsApplication + */ + WindowsApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.Inventory.WindowsApplication) + return object; + var message = new $root.google.cloud.osconfig.v1.Inventory.WindowsApplication(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.displayVersion != null) + message.displayVersion = String(object.displayVersion); + if (object.publisher != null) + message.publisher = String(object.publisher); + if (object.installDate != null) { + if (typeof object.installDate !== "object") + throw TypeError(".google.cloud.osconfig.v1.Inventory.WindowsApplication.installDate: object expected"); + message.installDate = $root.google.type.Date.fromObject(object.installDate); + } + if (object.helpLink != null) + message.helpLink = String(object.helpLink); + return message; + }; + + /** + * Creates a plain object from a WindowsApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {google.cloud.osconfig.v1.Inventory.WindowsApplication} message WindowsApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WindowsApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.displayName = ""; + object.displayVersion = ""; + object.publisher = ""; + object.installDate = null; + object.helpLink = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.displayVersion != null && message.hasOwnProperty("displayVersion")) + object.displayVersion = message.displayVersion; + if (message.publisher != null && message.hasOwnProperty("publisher")) + object.publisher = message.publisher; + if (message.installDate != null && message.hasOwnProperty("installDate")) + object.installDate = $root.google.type.Date.toObject(message.installDate, options); + if (message.helpLink != null && message.hasOwnProperty("helpLink")) + object.helpLink = message.helpLink; + return object; + }; + + /** + * Converts this WindowsApplication to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @instance + * @returns {Object.} JSON object + */ + WindowsApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WindowsApplication + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.Inventory.WindowsApplication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WindowsApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.Inventory.WindowsApplication"; + }; + + return WindowsApplication; + })(); + + return Inventory; + })(); + + v1.GetInventoryRequest = (function() { + + /** + * Properties of a GetInventoryRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IGetInventoryRequest + * @property {string|null} [name] GetInventoryRequest name + * @property {google.cloud.osconfig.v1.InventoryView|null} [view] GetInventoryRequest view + */ + + /** + * Constructs a new GetInventoryRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a GetInventoryRequest. + * @implements IGetInventoryRequest + * @constructor + * @param {google.cloud.osconfig.v1.IGetInventoryRequest=} [properties] Properties to set + */ + function GetInventoryRequest(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]]; + } + + /** + * GetInventoryRequest name. + * @member {string} name + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.name = ""; + + /** + * GetInventoryRequest view. + * @member {google.cloud.osconfig.v1.InventoryView} view + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + */ + GetInventoryRequest.prototype.view = 0; + + /** + * Creates a new GetInventoryRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest instance + */ + GetInventoryRequest.create = function create(properties) { + return new GetInventoryRequest(properties); + }; + + /** + * Encodes the specified GetInventoryRequest message. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetInventoryRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.GetInventoryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.IGetInventoryRequest} message GetInventoryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInventoryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.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.osconfig.v1.GetInventoryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetInventoryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInventoryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInventoryRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInventoryRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetInventoryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.GetInventoryRequest} GetInventoryRequest + */ + GetInventoryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.GetInventoryRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.GetInventoryRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetInventoryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {google.cloud.osconfig.v1.GetInventoryRequest} message GetInventoryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInventoryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] === undefined ? message.view : $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetInventoryRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @instance + * @returns {Object.} JSON object + */ + GetInventoryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetInventoryRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.GetInventoryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInventoryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.GetInventoryRequest"; + }; + + return GetInventoryRequest; + })(); + + v1.ListInventoriesRequest = (function() { + + /** + * Properties of a ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1 + * @interface IListInventoriesRequest + * @property {string|null} [parent] ListInventoriesRequest parent + * @property {google.cloud.osconfig.v1.InventoryView|null} [view] ListInventoriesRequest view + * @property {number|null} [pageSize] ListInventoriesRequest pageSize + * @property {string|null} [pageToken] ListInventoriesRequest pageToken + * @property {string|null} [filter] ListInventoriesRequest filter + */ + + /** + * Constructs a new ListInventoriesRequest. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListInventoriesRequest. + * @implements IListInventoriesRequest + * @constructor + * @param {google.cloud.osconfig.v1.IListInventoriesRequest=} [properties] Properties to set + */ + function ListInventoriesRequest(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]]; + } + + /** + * ListInventoriesRequest parent. + * @member {string} parent + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.parent = ""; + + /** + * ListInventoriesRequest view. + * @member {google.cloud.osconfig.v1.InventoryView} view + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.view = 0; + + /** + * ListInventoriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageSize = 0; + + /** + * ListInventoriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.pageToken = ""; + + /** + * ListInventoriesRequest filter. + * @member {string} filter + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + */ + ListInventoriesRequest.prototype.filter = ""; + + /** + * Creates a new ListInventoriesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest instance + */ + ListInventoriesRequest.create = function create(properties) { + return new ListInventoriesRequest(properties); + }; + + /** + * Encodes the specified ListInventoriesRequest message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListInventoriesRequest message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesRequest} message ListInventoriesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.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.osconfig.v1.ListInventoriesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesRequest message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListInventoriesRequest} ListInventoriesRequest + */ + ListInventoriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListInventoriesRequest) + return object; + var message = new $root.google.cloud.osconfig.v1.ListInventoriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "INVENTORY_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "FULL": + case 2: + message.view = 2; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {google.cloud.osconfig.v1.ListInventoriesRequest} message ListInventoriesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.view = options.enums === String ? "INVENTORY_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.osconfig.v1.InventoryView[message.view] === undefined ? message.view : $root.google.cloud.osconfig.v1.InventoryView[message.view] : message.view; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListInventoriesRequest to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInventoriesRequest + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListInventoriesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInventoriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListInventoriesRequest"; + }; + + return ListInventoriesRequest; + })(); + + v1.ListInventoriesResponse = (function() { + + /** + * Properties of a ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1 + * @interface IListInventoriesResponse + * @property {Array.|null} [inventories] ListInventoriesResponse inventories + * @property {string|null} [nextPageToken] ListInventoriesResponse nextPageToken + */ + + /** + * Constructs a new ListInventoriesResponse. + * @memberof google.cloud.osconfig.v1 + * @classdesc Represents a ListInventoriesResponse. + * @implements IListInventoriesResponse + * @constructor + * @param {google.cloud.osconfig.v1.IListInventoriesResponse=} [properties] Properties to set + */ + function ListInventoriesResponse(properties) { + this.inventories = []; + 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]]; + } + + /** + * ListInventoriesResponse inventories. + * @member {Array.} inventories + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.inventories = $util.emptyArray; + + /** + * ListInventoriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + */ + ListInventoriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListInventoriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse=} [properties] Properties to set + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse instance + */ + ListInventoriesResponse.create = function create(properties) { + return new ListInventoriesResponse(properties); + }; + + /** + * Encodes the specified ListInventoriesResponse message. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inventories != null && message.inventories.length) + for (var i = 0; i < message.inventories.length; ++i) + $root.google.cloud.osconfig.v1.Inventory.encode(message.inventories[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListInventoriesResponse message, length delimited. Does not implicitly {@link google.cloud.osconfig.v1.ListInventoriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.IListInventoriesResponse} message ListInventoriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInventoriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.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.osconfig.v1.ListInventoriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.inventories && message.inventories.length)) + message.inventories = []; + message.inventories.push($root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListInventoriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInventoriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInventoriesResponse message. + * @function verify + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInventoriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inventories != null && message.hasOwnProperty("inventories")) { + if (!Array.isArray(message.inventories)) + return "inventories: array expected"; + for (var i = 0; i < message.inventories.length; ++i) { + var error = $root.google.cloud.osconfig.v1.Inventory.verify(message.inventories[i]); + if (error) + return "inventories." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListInventoriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.osconfig.v1.ListInventoriesResponse} ListInventoriesResponse + */ + ListInventoriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.osconfig.v1.ListInventoriesResponse) + return object; + var message = new $root.google.cloud.osconfig.v1.ListInventoriesResponse(); + if (object.inventories) { + if (!Array.isArray(object.inventories)) + throw TypeError(".google.cloud.osconfig.v1.ListInventoriesResponse.inventories: array expected"); + message.inventories = []; + for (var i = 0; i < object.inventories.length; ++i) { + if (typeof object.inventories[i] !== "object") + throw TypeError(".google.cloud.osconfig.v1.ListInventoriesResponse.inventories: object expected"); + message.inventories[i] = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.inventories[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListInventoriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {google.cloud.osconfig.v1.ListInventoriesResponse} message ListInventoriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInventoriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.inventories = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.inventories && message.inventories.length) { + object.inventories = []; + for (var j = 0; j < message.inventories.length; ++j) + object.inventories[j] = $root.google.cloud.osconfig.v1.Inventory.toObject(message.inventories[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListInventoriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInventoriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListInventoriesResponse + * @function getTypeUrl + * @memberof google.cloud.osconfig.v1.ListInventoriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInventoriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.osconfig.v1.ListInventoriesResponse"; + }; + + return ListInventoriesResponse; + })(); + + /** + * InventoryView enum. + * @name google.cloud.osconfig.v1.InventoryView + * @enum {number} + * @property {number} INVENTORY_VIEW_UNSPECIFIED=0 INVENTORY_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.InventoryView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INVENTORY_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + return v1; + })(); + + return osconfig; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + 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]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + 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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + 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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + 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]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.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.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + 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]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + 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]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + 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]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(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]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Date = (function() { + + /** + * Properties of a Date. + * @memberof google.type + * @interface IDate + * @property {number|null} [year] Date year + * @property {number|null} [month] Date month + * @property {number|null} [day] Date day + */ + + /** + * Constructs a new Date. + * @memberof google.type + * @classdesc Represents a Date. + * @implements IDate + * @constructor + * @param {google.type.IDate=} [properties] Properties to set + */ + function Date(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Date year. + * @member {number} year + * @memberof google.type.Date + * @instance + */ + Date.prototype.year = 0; + + /** + * Date month. + * @member {number} month + * @memberof google.type.Date + * @instance + */ + Date.prototype.month = 0; + + /** + * Date day. + * @member {number} day + * @memberof google.type.Date + * @instance + */ + Date.prototype.day = 0; + + /** + * Creates a new Date instance using the specified properties. + * @function create + * @memberof google.type.Date + * @static + * @param {google.type.IDate=} [properties] Properties to set + * @returns {google.type.Date} Date instance + */ + Date.create = function create(properties) { + return new Date(properties); + }; + + /** + * Encodes the specified Date message. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encode + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.month); + if (message.day != null && Object.hasOwnProperty.call(message, "day")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.day); + return writer; + }; + + /** + * Encodes the specified Date message, length delimited. Does not implicitly {@link google.type.Date.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Date + * @static + * @param {google.type.IDate} message Date message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Date.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Date message from the specified reader or buffer. + * @function decode + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Date(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.year = reader.int32(); + break; + } + case 2: { + message.month = reader.int32(); + break; + } + case 3: { + message.day = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Date message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Date + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Date} Date + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Date.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Date message. + * @function verify + * @memberof google.type.Date + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Date.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.day != null && message.hasOwnProperty("day")) + if (!$util.isInteger(message.day)) + return "day: integer expected"; + return null; + }; + + /** + * Creates a Date message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Date + * @static + * @param {Object.} object Plain object + * @returns {google.type.Date} Date + */ + Date.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Date) + return object; + var message = new $root.google.type.Date(); + if (object.year != null) + message.year = object.year | 0; + if (object.month != null) + message.month = object.month | 0; + if (object.day != null) + message.day = object.day | 0; + return message; + }; + + /** + * Creates a plain object from a Date message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Date + * @static + * @param {google.type.Date} message Date + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Date.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.year = 0; + object.month = 0; + object.day = 0; + } + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.day != null && message.hasOwnProperty("day")) + object.day = message.day; + return object; + }; + + /** + * Converts this Date to JSON. + * @function toJSON + * @memberof google.type.Date + * @instance + * @returns {Object.} JSON object + */ + Date.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Date + * @function getTypeUrl + * @memberof google.type.Date + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Date.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Date"; + }; + + return Date; + })(); + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + 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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + 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]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.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.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.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.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + 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]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.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.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.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.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.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.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.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.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.identity = (function() { + + /** + * Namespace identity. + * @memberof google + * @namespace + */ + var identity = {}; + + identity.accesscontextmanager = (function() { + + /** + * Namespace accesscontextmanager. + * @memberof google.identity + * @namespace + */ + var accesscontextmanager = {}; + + accesscontextmanager.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var v1 = {}; + + v1.AccessLevel = (function() { + + /** + * Properties of an AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessLevel + * @property {string|null} [name] AccessLevel name + * @property {string|null} [title] AccessLevel title + * @property {string|null} [description] AccessLevel description + * @property {google.identity.accesscontextmanager.v1.IBasicLevel|null} [basic] AccessLevel basic + * @property {google.identity.accesscontextmanager.v1.ICustomLevel|null} [custom] AccessLevel custom + * @property {google.protobuf.ITimestamp|null} [createTime] AccessLevel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessLevel updateTime + */ + + /** + * Constructs a new AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessLevel. + * @implements IAccessLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + */ + function AccessLevel(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]]; + } + + /** + * AccessLevel name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.name = ""; + + /** + * AccessLevel title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.title = ""; + + /** + * AccessLevel description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.description = ""; + + /** + * AccessLevel basic. + * @member {google.identity.accesscontextmanager.v1.IBasicLevel|null|undefined} basic + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.basic = null; + + /** + * AccessLevel custom. + * @member {google.identity.accesscontextmanager.v1.ICustomLevel|null|undefined} custom + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.custom = null; + + /** + * AccessLevel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.createTime = null; + + /** + * AccessLevel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessLevel level. + * @member {"basic"|"custom"|undefined} level + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + Object.defineProperty(AccessLevel.prototype, "level", { + get: $util.oneOfGetter($oneOfFields = ["basic", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel instance + */ + AccessLevel.create = function create(properties) { + return new AccessLevel(properties); + }; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.basic != null && Object.hasOwnProperty.call(message, "basic")) + $root.google.identity.accesscontextmanager.v1.BasicLevel.encode(message.basic, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.identity.accesscontextmanager.v1.CustomLevel.encode(message.custom, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.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.identity.accesscontextmanager.v1.AccessLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.decode(reader, reader.uint32()); + break; + } + case 5: { + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.basic != null && message.hasOwnProperty("basic")) { + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.BasicLevel.verify(message.basic); + if (error) + return "basic." + error; + } + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.level === 1) + return "level: multiple values"; + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.CustomLevel.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an AccessLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + */ + AccessLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessLevel(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.basic != null) { + if (typeof object.basic !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.basic: object expected"); + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.fromObject(object.basic); + } + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.custom: object expected"); + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.fromObject(object.custom); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.AccessLevel} message AccessLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.basic != null && message.hasOwnProperty("basic")) { + object.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.toObject(message.basic, options); + if (options.oneofs) + object.level = "basic"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.toObject(message.custom, options); + if (options.oneofs) + object.level = "custom"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this AccessLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + * @returns {Object.} JSON object + */ + AccessLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessLevel"; + }; + + return AccessLevel; + })(); + + v1.BasicLevel = (function() { + + /** + * Properties of a BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IBasicLevel + * @property {Array.|null} [conditions] BasicLevel conditions + * @property {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null} [combiningFunction] BasicLevel combiningFunction + */ + + /** + * Constructs a new BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a BasicLevel. + * @implements IBasicLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + */ + function BasicLevel(properties) { + this.conditions = []; + 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]]; + } + + /** + * BasicLevel conditions. + * @member {Array.} conditions + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.conditions = $util.emptyArray; + + /** + * BasicLevel combiningFunction. + * @member {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction} combiningFunction + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.combiningFunction = 0; + + /** + * Creates a new BasicLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel instance + */ + BasicLevel.create = function create(properties) { + return new BasicLevel(properties); + }; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.identity.accesscontextmanager.v1.Condition.encode(message.conditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.combiningFunction != null && Object.hasOwnProperty.call(message, "combiningFunction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.combiningFunction); + return writer; + }; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.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.identity.accesscontextmanager.v1.BasicLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.identity.accesscontextmanager.v1.Condition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.combiningFunction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + switch (message.combiningFunction) { + default: + return "combiningFunction: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a BasicLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + */ + BasicLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.BasicLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.BasicLevel(); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: object expected"); + message.conditions[i] = $root.google.identity.accesscontextmanager.v1.Condition.fromObject(object.conditions[i]); + } + } + switch (object.combiningFunction) { + default: + if (typeof object.combiningFunction === "number") { + message.combiningFunction = object.combiningFunction; + break; + } + break; + case "AND": + case 0: + message.combiningFunction = 0; + break; + case "OR": + case 1: + message.combiningFunction = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.BasicLevel} message BasicLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (options.defaults) + object.combiningFunction = options.enums === String ? "AND" : 0; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.identity.accesscontextmanager.v1.Condition.toObject(message.conditions[j], options); + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + object.combiningFunction = options.enums === String ? $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] === undefined ? message.combiningFunction : $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] : message.combiningFunction; + return object; + }; + + /** + * Converts this BasicLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + * @returns {Object.} JSON object + */ + BasicLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BasicLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BasicLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.BasicLevel"; + }; + + /** + * ConditionCombiningFunction enum. + * @name google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + * @enum {number} + * @property {number} AND=0 AND value + * @property {number} OR=1 OR value + */ + BasicLevel.ConditionCombiningFunction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AND"] = 0; + values[valuesById[1] = "OR"] = 1; + return values; + })(); + + return BasicLevel; + })(); + + v1.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICondition + * @property {Array.|null} [ipSubnetworks] Condition ipSubnetworks + * @property {google.identity.accesscontextmanager.v1.IDevicePolicy|null} [devicePolicy] Condition devicePolicy + * @property {Array.|null} [requiredAccessLevels] Condition requiredAccessLevels + * @property {boolean|null} [negate] Condition negate + * @property {Array.|null} [members] Condition members + * @property {Array.|null} [regions] Condition regions + */ + + /** + * Constructs a new Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + this.ipSubnetworks = []; + this.requiredAccessLevels = []; + this.members = []; + this.regions = []; + 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]]; + } + + /** + * Condition ipSubnetworks. + * @member {Array.} ipSubnetworks + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.ipSubnetworks = $util.emptyArray; + + /** + * Condition devicePolicy. + * @member {google.identity.accesscontextmanager.v1.IDevicePolicy|null|undefined} devicePolicy + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.devicePolicy = null; + + /** + * Condition requiredAccessLevels. + * @member {Array.} requiredAccessLevels + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.requiredAccessLevels = $util.emptyArray; + + /** + * Condition negate. + * @member {boolean} negate + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.negate = false; + + /** + * Condition members. + * @member {Array.} members + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.members = $util.emptyArray; + + /** + * Condition regions. + * @member {Array.} regions + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.regions = $util.emptyArray; + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipSubnetworks != null && message.ipSubnetworks.length) + for (var i = 0; i < message.ipSubnetworks.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipSubnetworks[i]); + if (message.devicePolicy != null && Object.hasOwnProperty.call(message, "devicePolicy")) + $root.google.identity.accesscontextmanager.v1.DevicePolicy.encode(message.devicePolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requiredAccessLevels != null && message.requiredAccessLevels.length) + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requiredAccessLevels[i]); + if (message.negate != null && Object.hasOwnProperty.call(message, "negate")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.negate); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.members[i]); + if (message.regions != null && message.regions.length) + for (var i = 0; i < message.regions.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.regions[i]); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.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.identity.accesscontextmanager.v1.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ipSubnetworks && message.ipSubnetworks.length)) + message.ipSubnetworks = []; + message.ipSubnetworks.push(reader.string()); + break; + } + case 2: { + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.requiredAccessLevels && message.requiredAccessLevels.length)) + message.requiredAccessLevels = []; + message.requiredAccessLevels.push(reader.string()); + break; + } + case 5: { + message.negate = reader.bool(); + break; + } + case 6: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 7: { + if (!(message.regions && message.regions.length)) + message.regions = []; + message.regions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipSubnetworks != null && message.hasOwnProperty("ipSubnetworks")) { + if (!Array.isArray(message.ipSubnetworks)) + return "ipSubnetworks: array expected"; + for (var i = 0; i < message.ipSubnetworks.length; ++i) + if (!$util.isString(message.ipSubnetworks[i])) + return "ipSubnetworks: string[] expected"; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) { + var error = $root.google.identity.accesscontextmanager.v1.DevicePolicy.verify(message.devicePolicy); + if (error) + return "devicePolicy." + error; + } + if (message.requiredAccessLevels != null && message.hasOwnProperty("requiredAccessLevels")) { + if (!Array.isArray(message.requiredAccessLevels)) + return "requiredAccessLevels: array expected"; + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + if (!$util.isString(message.requiredAccessLevels[i])) + return "requiredAccessLevels: string[] expected"; + } + if (message.negate != null && message.hasOwnProperty("negate")) + if (typeof message.negate !== "boolean") + return "negate: boolean expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.regions != null && message.hasOwnProperty("regions")) { + if (!Array.isArray(message.regions)) + return "regions: array expected"; + for (var i = 0; i < message.regions.length; ++i) + if (!$util.isString(message.regions[i])) + return "regions: string[] expected"; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.Condition) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.Condition(); + if (object.ipSubnetworks) { + if (!Array.isArray(object.ipSubnetworks)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.ipSubnetworks: array expected"); + message.ipSubnetworks = []; + for (var i = 0; i < object.ipSubnetworks.length; ++i) + message.ipSubnetworks[i] = String(object.ipSubnetworks[i]); + } + if (object.devicePolicy != null) { + if (typeof object.devicePolicy !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.devicePolicy: object expected"); + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.fromObject(object.devicePolicy); + } + if (object.requiredAccessLevels) { + if (!Array.isArray(object.requiredAccessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.requiredAccessLevels: array expected"); + message.requiredAccessLevels = []; + for (var i = 0; i < object.requiredAccessLevels.length; ++i) + message.requiredAccessLevels[i] = String(object.requiredAccessLevels[i]); + } + if (object.negate != null) + message.negate = Boolean(object.negate); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.regions) { + if (!Array.isArray(object.regions)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.regions: array expected"); + message.regions = []; + for (var i = 0; i < object.regions.length; ++i) + message.regions[i] = String(object.regions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipSubnetworks = []; + object.requiredAccessLevels = []; + object.members = []; + object.regions = []; + } + if (options.defaults) { + object.devicePolicy = null; + object.negate = false; + } + if (message.ipSubnetworks && message.ipSubnetworks.length) { + object.ipSubnetworks = []; + for (var j = 0; j < message.ipSubnetworks.length; ++j) + object.ipSubnetworks[j] = message.ipSubnetworks[j]; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) + object.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.toObject(message.devicePolicy, options); + if (message.requiredAccessLevels && message.requiredAccessLevels.length) { + object.requiredAccessLevels = []; + for (var j = 0; j < message.requiredAccessLevels.length; ++j) + object.requiredAccessLevels[j] = message.requiredAccessLevels[j]; + } + if (message.negate != null && message.hasOwnProperty("negate")) + object.negate = message.negate; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.regions && message.regions.length) { + object.regions = []; + for (var j = 0; j < message.regions.length; ++j) + object.regions[j] = message.regions[j]; + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.Condition"; + }; + + return Condition; + })(); + + v1.CustomLevel = (function() { + + /** + * Properties of a CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICustomLevel + * @property {google.type.IExpr|null} [expr] CustomLevel expr + */ + + /** + * Constructs a new CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a CustomLevel. + * @implements ICustomLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + */ + function CustomLevel(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]]; + } + + /** + * CustomLevel expr. + * @member {google.type.IExpr|null|undefined} expr + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + */ + CustomLevel.prototype.expr = null; + + /** + * Creates a new CustomLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel instance + */ + CustomLevel.create = function create(properties) { + return new CustomLevel(properties); + }; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.google.type.Expr.encode(message.expr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.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.identity.accesscontextmanager.v1.CustomLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expr = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.google.type.Expr.verify(message.expr); + if (error) + return "expr." + error; + } + return null; + }; + + /** + * Creates a CustomLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + */ + CustomLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.CustomLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.CustomLevel(); + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.CustomLevel.expr: object expected"); + message.expr = $root.google.type.Expr.fromObject(object.expr); + } + return message; + }; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.CustomLevel} message CustomLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expr = null; + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.google.type.Expr.toObject(message.expr, options); + return object; + }; + + /** + * Converts this CustomLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + * @returns {Object.} JSON object + */ + CustomLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.CustomLevel"; + }; + + return CustomLevel; + })(); + + v1.DevicePolicy = (function() { + + /** + * Properties of a DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IDevicePolicy + * @property {boolean|null} [requireScreenlock] DevicePolicy requireScreenlock + * @property {Array.|null} [allowedEncryptionStatuses] DevicePolicy allowedEncryptionStatuses + * @property {Array.|null} [osConstraints] DevicePolicy osConstraints + * @property {Array.|null} [allowedDeviceManagementLevels] DevicePolicy allowedDeviceManagementLevels + * @property {boolean|null} [requireAdminApproval] DevicePolicy requireAdminApproval + * @property {boolean|null} [requireCorpOwned] DevicePolicy requireCorpOwned + */ + + /** + * Constructs a new DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a DevicePolicy. + * @implements IDevicePolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + */ + function DevicePolicy(properties) { + this.allowedEncryptionStatuses = []; + this.osConstraints = []; + this.allowedDeviceManagementLevels = []; + 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]]; + } + + /** + * DevicePolicy requireScreenlock. + * @member {boolean} requireScreenlock + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireScreenlock = false; + + /** + * DevicePolicy allowedEncryptionStatuses. + * @member {Array.} allowedEncryptionStatuses + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedEncryptionStatuses = $util.emptyArray; + + /** + * DevicePolicy osConstraints. + * @member {Array.} osConstraints + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.osConstraints = $util.emptyArray; + + /** + * DevicePolicy allowedDeviceManagementLevels. + * @member {Array.} allowedDeviceManagementLevels + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedDeviceManagementLevels = $util.emptyArray; + + /** + * DevicePolicy requireAdminApproval. + * @member {boolean} requireAdminApproval + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireAdminApproval = false; + + /** + * DevicePolicy requireCorpOwned. + * @member {boolean} requireCorpOwned + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireCorpOwned = false; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy instance + */ + DevicePolicy.create = function create(properties) { + return new DevicePolicy(properties); + }; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireScreenlock != null && Object.hasOwnProperty.call(message, "requireScreenlock")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireScreenlock); + if (message.allowedEncryptionStatuses != null && message.allowedEncryptionStatuses.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + writer.int32(message.allowedEncryptionStatuses[i]); + writer.ldelim(); + } + if (message.osConstraints != null && message.osConstraints.length) + for (var i = 0; i < message.osConstraints.length; ++i) + $root.google.identity.accesscontextmanager.v1.OsConstraint.encode(message.osConstraints[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowedDeviceManagementLevels != null && message.allowedDeviceManagementLevels.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + writer.int32(message.allowedDeviceManagementLevels[i]); + writer.ldelim(); + } + if (message.requireAdminApproval != null && Object.hasOwnProperty.call(message, "requireAdminApproval")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requireAdminApproval); + if (message.requireCorpOwned != null && Object.hasOwnProperty.call(message, "requireCorpOwned")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.requireCorpOwned); + return writer; + }; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.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.identity.accesscontextmanager.v1.DevicePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requireScreenlock = reader.bool(); + break; + } + case 2: { + if (!(message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length)) + message.allowedEncryptionStatuses = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedEncryptionStatuses.push(reader.int32()); + } else + message.allowedEncryptionStatuses.push(reader.int32()); + break; + } + case 3: { + if (!(message.osConstraints && message.osConstraints.length)) + message.osConstraints = []; + message.osConstraints.push($root.google.identity.accesscontextmanager.v1.OsConstraint.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length)) + message.allowedDeviceManagementLevels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedDeviceManagementLevels.push(reader.int32()); + } else + message.allowedDeviceManagementLevels.push(reader.int32()); + break; + } + case 7: { + message.requireAdminApproval = reader.bool(); + break; + } + case 8: { + message.requireCorpOwned = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DevicePolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DevicePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + if (typeof message.requireScreenlock !== "boolean") + return "requireScreenlock: boolean expected"; + if (message.allowedEncryptionStatuses != null && message.hasOwnProperty("allowedEncryptionStatuses")) { + if (!Array.isArray(message.allowedEncryptionStatuses)) + return "allowedEncryptionStatuses: array expected"; + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + switch (message.allowedEncryptionStatuses[i]) { + default: + return "allowedEncryptionStatuses: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.osConstraints != null && message.hasOwnProperty("osConstraints")) { + if (!Array.isArray(message.osConstraints)) + return "osConstraints: array expected"; + for (var i = 0; i < message.osConstraints.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.OsConstraint.verify(message.osConstraints[i]); + if (error) + return "osConstraints." + error; + } + } + if (message.allowedDeviceManagementLevels != null && message.hasOwnProperty("allowedDeviceManagementLevels")) { + if (!Array.isArray(message.allowedDeviceManagementLevels)) + return "allowedDeviceManagementLevels: array expected"; + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + switch (message.allowedDeviceManagementLevels[i]) { + default: + return "allowedDeviceManagementLevels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + if (typeof message.requireAdminApproval !== "boolean") + return "requireAdminApproval: boolean expected"; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + if (typeof message.requireCorpOwned !== "boolean") + return "requireCorpOwned: boolean expected"; + return null; + }; + + /** + * Creates a DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + */ + DevicePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.DevicePolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.DevicePolicy(); + if (object.requireScreenlock != null) + message.requireScreenlock = Boolean(object.requireScreenlock); + if (object.allowedEncryptionStatuses) { + if (!Array.isArray(object.allowedEncryptionStatuses)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedEncryptionStatuses: array expected"); + message.allowedEncryptionStatuses = []; + for (var i = 0; i < object.allowedEncryptionStatuses.length; ++i) + switch (object.allowedEncryptionStatuses[i]) { + default: + if (typeof object.allowedEncryptionStatuses[i] === "number") { + message.allowedEncryptionStatuses[i] = object.allowedEncryptionStatuses[i]; + break; + } + case "ENCRYPTION_UNSPECIFIED": + case 0: + message.allowedEncryptionStatuses[i] = 0; + break; + case "ENCRYPTION_UNSUPPORTED": + case 1: + message.allowedEncryptionStatuses[i] = 1; + break; + case "UNENCRYPTED": + case 2: + message.allowedEncryptionStatuses[i] = 2; + break; + case "ENCRYPTED": + case 3: + message.allowedEncryptionStatuses[i] = 3; + break; + } + } + if (object.osConstraints) { + if (!Array.isArray(object.osConstraints)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: array expected"); + message.osConstraints = []; + for (var i = 0; i < object.osConstraints.length; ++i) { + if (typeof object.osConstraints[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: object expected"); + message.osConstraints[i] = $root.google.identity.accesscontextmanager.v1.OsConstraint.fromObject(object.osConstraints[i]); + } + } + if (object.allowedDeviceManagementLevels) { + if (!Array.isArray(object.allowedDeviceManagementLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedDeviceManagementLevels: array expected"); + message.allowedDeviceManagementLevels = []; + for (var i = 0; i < object.allowedDeviceManagementLevels.length; ++i) + switch (object.allowedDeviceManagementLevels[i]) { + default: + if (typeof object.allowedDeviceManagementLevels[i] === "number") { + message.allowedDeviceManagementLevels[i] = object.allowedDeviceManagementLevels[i]; + break; + } + case "MANAGEMENT_UNSPECIFIED": + case 0: + message.allowedDeviceManagementLevels[i] = 0; + break; + case "NONE": + case 1: + message.allowedDeviceManagementLevels[i] = 1; + break; + case "BASIC": + case 2: + message.allowedDeviceManagementLevels[i] = 2; + break; + case "COMPLETE": + case 3: + message.allowedDeviceManagementLevels[i] = 3; + break; + } + } + if (object.requireAdminApproval != null) + message.requireAdminApproval = Boolean(object.requireAdminApproval); + if (object.requireCorpOwned != null) + message.requireCorpOwned = Boolean(object.requireCorpOwned); + return message; + }; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.DevicePolicy} message DevicePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DevicePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedEncryptionStatuses = []; + object.osConstraints = []; + object.allowedDeviceManagementLevels = []; + } + if (options.defaults) { + object.requireScreenlock = false; + object.requireAdminApproval = false; + object.requireCorpOwned = false; + } + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + object.requireScreenlock = message.requireScreenlock; + if (message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length) { + object.allowedEncryptionStatuses = []; + for (var j = 0; j < message.allowedEncryptionStatuses.length; ++j) + object.allowedEncryptionStatuses[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] === undefined ? message.allowedEncryptionStatuses[j] : $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] : message.allowedEncryptionStatuses[j]; + } + if (message.osConstraints && message.osConstraints.length) { + object.osConstraints = []; + for (var j = 0; j < message.osConstraints.length; ++j) + object.osConstraints[j] = $root.google.identity.accesscontextmanager.v1.OsConstraint.toObject(message.osConstraints[j], options); + } + if (message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length) { + object.allowedDeviceManagementLevels = []; + for (var j = 0; j < message.allowedDeviceManagementLevels.length; ++j) + object.allowedDeviceManagementLevels[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] === undefined ? message.allowedDeviceManagementLevels[j] : $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] : message.allowedDeviceManagementLevels[j]; + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + object.requireAdminApproval = message.requireAdminApproval; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + object.requireCorpOwned = message.requireCorpOwned; + return object; + }; + + /** + * Converts this DevicePolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + * @returns {Object.} JSON object + */ + DevicePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DevicePolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DevicePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.DevicePolicy"; + }; + + return DevicePolicy; + })(); + + v1.OsConstraint = (function() { + + /** + * Properties of an OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IOsConstraint + * @property {google.identity.accesscontextmanager.type.OsType|null} [osType] OsConstraint osType + * @property {string|null} [minimumVersion] OsConstraint minimumVersion + * @property {boolean|null} [requireVerifiedChromeOs] OsConstraint requireVerifiedChromeOs + */ + + /** + * Constructs a new OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an OsConstraint. + * @implements IOsConstraint + * @constructor + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + */ + function OsConstraint(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]]; + } + + /** + * OsConstraint osType. + * @member {google.identity.accesscontextmanager.type.OsType} osType + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.osType = 0; + + /** + * OsConstraint minimumVersion. + * @member {string} minimumVersion + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.minimumVersion = ""; + + /** + * OsConstraint requireVerifiedChromeOs. + * @member {boolean} requireVerifiedChromeOs + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.requireVerifiedChromeOs = false; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint instance + */ + OsConstraint.create = function create(properties) { + return new OsConstraint(properties); + }; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osType != null && Object.hasOwnProperty.call(message, "osType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.osType); + if (message.minimumVersion != null && Object.hasOwnProperty.call(message, "minimumVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.minimumVersion); + if (message.requireVerifiedChromeOs != null && Object.hasOwnProperty.call(message, "requireVerifiedChromeOs")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requireVerifiedChromeOs); + return writer; + }; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.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.identity.accesscontextmanager.v1.OsConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osType = reader.int32(); + break; + } + case 2: { + message.minimumVersion = reader.string(); + break; + } + case 3: { + message.requireVerifiedChromeOs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsConstraint message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osType != null && message.hasOwnProperty("osType")) + switch (message.osType) { + default: + return "osType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + case 4: + case 5: + break; + } + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + if (!$util.isString(message.minimumVersion)) + return "minimumVersion: string expected"; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + if (typeof message.requireVerifiedChromeOs !== "boolean") + return "requireVerifiedChromeOs: boolean expected"; + return null; + }; + + /** + * Creates an OsConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + */ + OsConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.OsConstraint) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.OsConstraint(); + switch (object.osType) { + default: + if (typeof object.osType === "number") { + message.osType = object.osType; + break; + } + break; + case "OS_UNSPECIFIED": + case 0: + message.osType = 0; + break; + case "DESKTOP_MAC": + case 1: + message.osType = 1; + break; + case "DESKTOP_WINDOWS": + case 2: + message.osType = 2; + break; + case "DESKTOP_LINUX": + case 3: + message.osType = 3; + break; + case "DESKTOP_CHROME_OS": + case 6: + message.osType = 6; + break; + case "ANDROID": + case 4: + message.osType = 4; + break; + case "IOS": + case 5: + message.osType = 5; + break; + } + if (object.minimumVersion != null) + message.minimumVersion = String(object.minimumVersion); + if (object.requireVerifiedChromeOs != null) + message.requireVerifiedChromeOs = Boolean(object.requireVerifiedChromeOs); + return message; + }; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.OsConstraint} message OsConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osType = options.enums === String ? "OS_UNSPECIFIED" : 0; + object.minimumVersion = ""; + object.requireVerifiedChromeOs = false; + } + if (message.osType != null && message.hasOwnProperty("osType")) + object.osType = options.enums === String ? $root.google.identity.accesscontextmanager.type.OsType[message.osType] === undefined ? message.osType : $root.google.identity.accesscontextmanager.type.OsType[message.osType] : message.osType; + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + object.minimumVersion = message.minimumVersion; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + object.requireVerifiedChromeOs = message.requireVerifiedChromeOs; + return object; + }; + + /** + * Converts this OsConstraint to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + * @returns {Object.} JSON object + */ + OsConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OsConstraint + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.OsConstraint"; + }; + + return OsConstraint; + })(); + + v1.AccessPolicy = (function() { + + /** + * Properties of an AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessPolicy + * @property {string|null} [name] AccessPolicy name + * @property {string|null} [parent] AccessPolicy parent + * @property {string|null} [title] AccessPolicy title + * @property {Array.|null} [scopes] AccessPolicy scopes + * @property {google.protobuf.ITimestamp|null} [createTime] AccessPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessPolicy updateTime + * @property {string|null} [etag] AccessPolicy etag + */ + + /** + * Constructs a new AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessPolicy. + * @implements IAccessPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + */ + function AccessPolicy(properties) { + this.scopes = []; + 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]]; + } + + /** + * AccessPolicy name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.name = ""; + + /** + * AccessPolicy parent. + * @member {string} parent + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.parent = ""; + + /** + * AccessPolicy title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.title = ""; + + /** + * AccessPolicy scopes. + * @member {Array.} scopes + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.scopes = $util.emptyArray; + + /** + * AccessPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.createTime = null; + + /** + * AccessPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.updateTime = null; + + /** + * AccessPolicy etag. + * @member {string} etag + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.etag = ""; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy instance + */ + AccessPolicy.create = function create(properties) { + return new AccessPolicy(properties); + }; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.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.identity.accesscontextmanager.v1.AccessPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.title = reader.string(); + break; + } + case 7: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + */ + AccessPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.title != null) + message.title = String(object.title); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.AccessPolicy} message AccessPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.title = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this AccessPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + * @returns {Object.} JSON object + */ + AccessPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessPolicy"; + }; + + return AccessPolicy; + })(); + + v1.ServicePerimeter = (function() { + + /** + * Properties of a ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeter + * @property {string|null} [name] ServicePerimeter name + * @property {string|null} [title] ServicePerimeter title + * @property {string|null} [description] ServicePerimeter description + * @property {google.protobuf.ITimestamp|null} [createTime] ServicePerimeter createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ServicePerimeter updateTime + * @property {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null} [perimeterType] ServicePerimeter perimeterType + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [status] ServicePerimeter status + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [spec] ServicePerimeter spec + * @property {boolean|null} [useExplicitDryRunSpec] ServicePerimeter useExplicitDryRunSpec + */ + + /** + * Constructs a new ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeter. + * @implements IServicePerimeter + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + */ + function ServicePerimeter(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]]; + } + + /** + * ServicePerimeter name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.name = ""; + + /** + * ServicePerimeter title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.title = ""; + + /** + * ServicePerimeter description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.description = ""; + + /** + * ServicePerimeter createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.createTime = null; + + /** + * ServicePerimeter updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.updateTime = null; + + /** + * ServicePerimeter perimeterType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType} perimeterType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.perimeterType = 0; + + /** + * ServicePerimeter status. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} status + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.status = null; + + /** + * ServicePerimeter spec. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} spec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.spec = null; + + /** + * ServicePerimeter useExplicitDryRunSpec. + * @member {boolean} useExplicitDryRunSpec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.useExplicitDryRunSpec = false; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter instance + */ + ServicePerimeter.create = function create(properties) { + return new ServicePerimeter(properties); + }; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.perimeterType != null && Object.hasOwnProperty.call(message, "perimeterType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.perimeterType); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.spec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.useExplicitDryRunSpec != null && Object.hasOwnProperty.call(message, "useExplicitDryRunSpec")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.useExplicitDryRunSpec); + return writer; + }; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.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.identity.accesscontextmanager.v1.ServicePerimeter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.perimeterType = reader.int32(); + break; + } + case 7: { + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.useExplicitDryRunSpec = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServicePerimeter message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeter.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.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + switch (message.perimeterType) { + default: + return "perimeterType: enum value expected"; + case 0: + case 1: + break; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.status); + if (error) + return "status." + error; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + if (typeof message.useExplicitDryRunSpec !== "boolean") + return "useExplicitDryRunSpec: boolean expected"; + return null; + }; + + /** + * Creates a ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + */ + ServicePerimeter.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeter) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeter(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.perimeterType) { + default: + if (typeof object.perimeterType === "number") { + message.perimeterType = object.perimeterType; + break; + } + break; + case "PERIMETER_TYPE_REGULAR": + case 0: + message.perimeterType = 0; + break; + case "PERIMETER_TYPE_BRIDGE": + case 1: + message.perimeterType = 1; + break; + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.status: object expected"); + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.status); + } + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.spec: object expected"); + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.spec); + } + if (object.useExplicitDryRunSpec != null) + message.useExplicitDryRunSpec = Boolean(object.useExplicitDryRunSpec); + return message; + }; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeter} message ServicePerimeter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.perimeterType = options.enums === String ? "PERIMETER_TYPE_REGULAR" : 0; + object.status = null; + object.spec = null; + object.useExplicitDryRunSpec = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + object.perimeterType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] === undefined ? message.perimeterType : $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] : message.perimeterType; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.status, options); + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.spec, options); + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + object.useExplicitDryRunSpec = message.useExplicitDryRunSpec; + return object; + }; + + /** + * Converts this ServicePerimeter to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServicePerimeter + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeter"; + }; + + /** + * PerimeterType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + * @enum {number} + * @property {number} PERIMETER_TYPE_REGULAR=0 PERIMETER_TYPE_REGULAR value + * @property {number} PERIMETER_TYPE_BRIDGE=1 PERIMETER_TYPE_BRIDGE value + */ + ServicePerimeter.PerimeterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERIMETER_TYPE_REGULAR"] = 0; + values[valuesById[1] = "PERIMETER_TYPE_BRIDGE"] = 1; + return values; + })(); + + return ServicePerimeter; + })(); + + v1.ServicePerimeterConfig = (function() { + + /** + * Properties of a ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeterConfig + * @property {Array.|null} [resources] ServicePerimeterConfig resources + * @property {Array.|null} [accessLevels] ServicePerimeterConfig accessLevels + * @property {Array.|null} [restrictedServices] ServicePerimeterConfig restrictedServices + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null} [vpcAccessibleServices] ServicePerimeterConfig vpcAccessibleServices + * @property {Array.|null} [ingressPolicies] ServicePerimeterConfig ingressPolicies + * @property {Array.|null} [egressPolicies] ServicePerimeterConfig egressPolicies + */ + + /** + * Constructs a new ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeterConfig. + * @implements IServicePerimeterConfig + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + */ + function ServicePerimeterConfig(properties) { + this.resources = []; + this.accessLevels = []; + this.restrictedServices = []; + this.ingressPolicies = []; + this.egressPolicies = []; + 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]]; + } + + /** + * ServicePerimeterConfig resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.resources = $util.emptyArray; + + /** + * ServicePerimeterConfig accessLevels. + * @member {Array.} accessLevels + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.accessLevels = $util.emptyArray; + + /** + * ServicePerimeterConfig restrictedServices. + * @member {Array.} restrictedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.restrictedServices = $util.emptyArray; + + /** + * ServicePerimeterConfig vpcAccessibleServices. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null|undefined} vpcAccessibleServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.vpcAccessibleServices = null; + + /** + * ServicePerimeterConfig ingressPolicies. + * @member {Array.} ingressPolicies + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.ingressPolicies = $util.emptyArray; + + /** + * ServicePerimeterConfig egressPolicies. + * @member {Array.} egressPolicies + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.egressPolicies = $util.emptyArray; + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig instance + */ + ServicePerimeterConfig.create = function create(properties) { + return new ServicePerimeterConfig(properties); + }; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.accessLevels != null && message.accessLevels.length) + for (var i = 0; i < message.accessLevels.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessLevels[i]); + if (message.restrictedServices != null && message.restrictedServices.length) + for (var i = 0; i < message.restrictedServices.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.restrictedServices[i]); + if (message.ingressPolicies != null && message.ingressPolicies.length) + for (var i = 0; i < message.ingressPolicies.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.encode(message.ingressPolicies[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.egressPolicies != null && message.egressPolicies.length) + for (var i = 0; i < message.egressPolicies.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.encode(message.egressPolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.vpcAccessibleServices != null && Object.hasOwnProperty.call(message, "vpcAccessibleServices")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.encode(message.vpcAccessibleServices, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.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.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.accessLevels && message.accessLevels.length)) + message.accessLevels = []; + message.accessLevels.push(reader.string()); + break; + } + case 4: { + if (!(message.restrictedServices && message.restrictedServices.length)) + message.restrictedServices = []; + message.restrictedServices.push(reader.string()); + break; + } + case 10: { + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.ingressPolicies && message.ingressPolicies.length)) + message.ingressPolicies = []; + message.ingressPolicies.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.egressPolicies && message.egressPolicies.length)) + message.egressPolicies = []; + message.egressPolicies.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServicePerimeterConfig message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeterConfig.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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.accessLevels != null && message.hasOwnProperty("accessLevels")) { + if (!Array.isArray(message.accessLevels)) + return "accessLevels: array expected"; + for (var i = 0; i < message.accessLevels.length; ++i) + if (!$util.isString(message.accessLevels[i])) + return "accessLevels: string[] expected"; + } + if (message.restrictedServices != null && message.hasOwnProperty("restrictedServices")) { + if (!Array.isArray(message.restrictedServices)) + return "restrictedServices: array expected"; + for (var i = 0; i < message.restrictedServices.length; ++i) + if (!$util.isString(message.restrictedServices[i])) + return "restrictedServices: string[] expected"; + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify(message.vpcAccessibleServices); + if (error) + return "vpcAccessibleServices." + error; + } + if (message.ingressPolicies != null && message.hasOwnProperty("ingressPolicies")) { + if (!Array.isArray(message.ingressPolicies)) + return "ingressPolicies: array expected"; + for (var i = 0; i < message.ingressPolicies.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify(message.ingressPolicies[i]); + if (error) + return "ingressPolicies." + error; + } + } + if (message.egressPolicies != null && message.hasOwnProperty("egressPolicies")) { + if (!Array.isArray(message.egressPolicies)) + return "egressPolicies: array expected"; + for (var i = 0; i < message.egressPolicies.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify(message.egressPolicies[i]); + if (error) + return "egressPolicies." + error; + } + } + return null; + }; + + /** + * Creates a ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + */ + ServicePerimeterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.accessLevels) { + if (!Array.isArray(object.accessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.accessLevels: array expected"); + message.accessLevels = []; + for (var i = 0; i < object.accessLevels.length; ++i) + message.accessLevels[i] = String(object.accessLevels[i]); + } + if (object.restrictedServices) { + if (!Array.isArray(object.restrictedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.restrictedServices: array expected"); + message.restrictedServices = []; + for (var i = 0; i < object.restrictedServices.length; ++i) + message.restrictedServices[i] = String(object.restrictedServices[i]); + } + if (object.vpcAccessibleServices != null) { + if (typeof object.vpcAccessibleServices !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.vpcAccessibleServices: object expected"); + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.fromObject(object.vpcAccessibleServices); + } + if (object.ingressPolicies) { + if (!Array.isArray(object.ingressPolicies)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ingressPolicies: array expected"); + message.ingressPolicies = []; + for (var i = 0; i < object.ingressPolicies.length; ++i) { + if (typeof object.ingressPolicies[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ingressPolicies: object expected"); + message.ingressPolicies[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.fromObject(object.ingressPolicies[i]); + } + } + if (object.egressPolicies) { + if (!Array.isArray(object.egressPolicies)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.egressPolicies: array expected"); + message.egressPolicies = []; + for (var i = 0; i < object.egressPolicies.length; ++i) { + if (typeof object.egressPolicies[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.egressPolicies: object expected"); + message.egressPolicies[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.fromObject(object.egressPolicies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} message ServicePerimeterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accessLevels = []; + object.restrictedServices = []; + object.ingressPolicies = []; + object.egressPolicies = []; + } + if (options.defaults) + object.vpcAccessibleServices = null; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.accessLevels && message.accessLevels.length) { + object.accessLevels = []; + for (var j = 0; j < message.accessLevels.length; ++j) + object.accessLevels[j] = message.accessLevels[j]; + } + if (message.restrictedServices && message.restrictedServices.length) { + object.restrictedServices = []; + for (var j = 0; j < message.restrictedServices.length; ++j) + object.restrictedServices[j] = message.restrictedServices[j]; + } + if (message.ingressPolicies && message.ingressPolicies.length) { + object.ingressPolicies = []; + for (var j = 0; j < message.ingressPolicies.length; ++j) + object.ingressPolicies[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.toObject(message.ingressPolicies[j], options); + } + if (message.egressPolicies && message.egressPolicies.length) { + object.egressPolicies = []; + for (var j = 0; j < message.egressPolicies.length; ++j) + object.egressPolicies[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.toObject(message.egressPolicies[j], options); + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) + object.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.toObject(message.vpcAccessibleServices, options); + return object; + }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig"; + }; + + ServicePerimeterConfig.VpcAccessibleServices = (function() { + + /** + * Properties of a VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IVpcAccessibleServices + * @property {boolean|null} [enableRestriction] VpcAccessibleServices enableRestriction + * @property {Array.|null} [allowedServices] VpcAccessibleServices allowedServices + */ + + /** + * Constructs a new VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a VpcAccessibleServices. + * @implements IVpcAccessibleServices + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + */ + function VpcAccessibleServices(properties) { + this.allowedServices = []; + 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]]; + } + + /** + * VpcAccessibleServices enableRestriction. + * @member {boolean} enableRestriction + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.enableRestriction = false; + + /** + * VpcAccessibleServices allowedServices. + * @member {Array.} allowedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.allowedServices = $util.emptyArray; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices instance + */ + VpcAccessibleServices.create = function create(properties) { + return new VpcAccessibleServices(properties); + }; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRestriction != null && Object.hasOwnProperty.call(message, "enableRestriction")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRestriction); + if (message.allowedServices != null && message.allowedServices.length) + for (var i = 0; i < message.allowedServices.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedServices[i]); + return writer; + }; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableRestriction = reader.bool(); + break; + } + case 2: { + if (!(message.allowedServices && message.allowedServices.length)) + message.allowedServices = []; + message.allowedServices.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcAccessibleServices message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcAccessibleServices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + if (typeof message.enableRestriction !== "boolean") + return "enableRestriction: boolean expected"; + if (message.allowedServices != null && message.hasOwnProperty("allowedServices")) { + if (!Array.isArray(message.allowedServices)) + return "allowedServices: array expected"; + for (var i = 0; i < message.allowedServices.length; ++i) + if (!$util.isString(message.allowedServices[i])) + return "allowedServices: string[] expected"; + } + return null; + }; + + /** + * Creates a VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + */ + VpcAccessibleServices.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + if (object.enableRestriction != null) + message.enableRestriction = Boolean(object.enableRestriction); + if (object.allowedServices) { + if (!Array.isArray(object.allowedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.allowedServices: array expected"); + message.allowedServices = []; + for (var i = 0; i < object.allowedServices.length; ++i) + message.allowedServices[i] = String(object.allowedServices[i]); + } + return message; + }; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} message VpcAccessibleServices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcAccessibleServices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedServices = []; + if (options.defaults) + object.enableRestriction = false; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + object.enableRestriction = message.enableRestriction; + if (message.allowedServices && message.allowedServices.length) { + object.allowedServices = []; + for (var j = 0; j < message.allowedServices.length; ++j) + object.allowedServices[j] = message.allowedServices[j]; + } + return object; + }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + * @returns {Object.} JSON object + */ + VpcAccessibleServices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcAccessibleServices + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcAccessibleServices.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices"; + }; + + return VpcAccessibleServices; + })(); + + /** + * IdentityType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType + * @enum {number} + * @property {number} IDENTITY_TYPE_UNSPECIFIED=0 IDENTITY_TYPE_UNSPECIFIED value + * @property {number} ANY_IDENTITY=1 ANY_IDENTITY value + * @property {number} ANY_USER_ACCOUNT=2 ANY_USER_ACCOUNT value + * @property {number} ANY_SERVICE_ACCOUNT=3 ANY_SERVICE_ACCOUNT value + */ + ServicePerimeterConfig.IdentityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDENTITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ANY_IDENTITY"] = 1; + values[valuesById[2] = "ANY_USER_ACCOUNT"] = 2; + values[valuesById[3] = "ANY_SERVICE_ACCOUNT"] = 3; + return values; + })(); + + ServicePerimeterConfig.MethodSelector = (function() { + + /** + * Properties of a MethodSelector. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IMethodSelector + * @property {string|null} [method] MethodSelector method + * @property {string|null} [permission] MethodSelector permission + */ + + /** + * Constructs a new MethodSelector. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a MethodSelector. + * @implements IMethodSelector + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector=} [properties] Properties to set + */ + function MethodSelector(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]]; + } + + /** + * MethodSelector method. + * @member {string|null|undefined} method + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + MethodSelector.prototype.method = null; + + /** + * MethodSelector permission. + * @member {string|null|undefined} permission + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + MethodSelector.prototype.permission = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MethodSelector kind. + * @member {"method"|"permission"|undefined} kind + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + Object.defineProperty(MethodSelector.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["method", "permission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MethodSelector instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector instance + */ + MethodSelector.create = function create(properties) { + return new MethodSelector(properties); + }; + + /** + * Encodes the specified MethodSelector message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector} message MethodSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.method); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + return writer; + }; + + /** + * Encodes the specified MethodSelector message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector} message MethodSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSelector message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSelector.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.method = reader.string(); + break; + } + case 2: { + message.permission = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSelector message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.method != null && message.hasOwnProperty("method")) { + properties.kind = 1; + if (!$util.isString(message.method)) + return "method: string expected"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.permission)) + return "permission: string expected"; + } + return null; + }; + + /** + * Creates a MethodSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + */ + MethodSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector(); + if (object.method != null) + message.method = String(object.method); + if (object.permission != null) + message.permission = String(object.permission); + return message; + }; + + /** + * Creates a plain object from a MethodSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} message MethodSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.method != null && message.hasOwnProperty("method")) { + object.method = message.method; + if (options.oneofs) + object.kind = "method"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + object.permission = message.permission; + if (options.oneofs) + object.kind = "permission"; + } + return object; + }; + + /** + * Converts this MethodSelector to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + * @returns {Object.} JSON object + */ + MethodSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSelector + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector"; + }; + + return MethodSelector; + })(); + + ServicePerimeterConfig.ApiOperation = (function() { + + /** + * Properties of an ApiOperation. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IApiOperation + * @property {string|null} [serviceName] ApiOperation serviceName + * @property {Array.|null} [methodSelectors] ApiOperation methodSelectors + */ + + /** + * Constructs a new ApiOperation. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an ApiOperation. + * @implements IApiOperation + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation=} [properties] Properties to set + */ + function ApiOperation(properties) { + this.methodSelectors = []; + 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]]; + } + + /** + * ApiOperation serviceName. + * @member {string} serviceName + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + */ + ApiOperation.prototype.serviceName = ""; + + /** + * ApiOperation methodSelectors. + * @member {Array.} methodSelectors + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + */ + ApiOperation.prototype.methodSelectors = $util.emptyArray; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation instance + */ + ApiOperation.create = function create(properties) { + return new ApiOperation(properties); + }; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.methodSelectors != null && message.methodSelectors.length) + for (var i = 0; i < message.methodSelectors.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.encode(message.methodSelectors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + if (!(message.methodSelectors && message.methodSelectors.length)) + message.methodSelectors = []; + message.methodSelectors.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiOperation message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.methodSelectors != null && message.hasOwnProperty("methodSelectors")) { + if (!Array.isArray(message.methodSelectors)) + return "methodSelectors: array expected"; + for (var i = 0; i < message.methodSelectors.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify(message.methodSelectors[i]); + if (error) + return "methodSelectors." + error; + } + } + return null; + }; + + /** + * Creates an ApiOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + */ + ApiOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.methodSelectors) { + if (!Array.isArray(object.methodSelectors)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.methodSelectors: array expected"); + message.methodSelectors = []; + for (var i = 0; i < object.methodSelectors.length; ++i) { + if (typeof object.methodSelectors[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.methodSelectors: object expected"); + message.methodSelectors[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.fromObject(object.methodSelectors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} message ApiOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methodSelectors = []; + if (options.defaults) + object.serviceName = ""; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.methodSelectors && message.methodSelectors.length) { + object.methodSelectors = []; + for (var j = 0; j < message.methodSelectors.length; ++j) + object.methodSelectors[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.toObject(message.methodSelectors[j], options); + } + return object; + }; + + /** + * Converts this ApiOperation to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + * @returns {Object.} JSON object + */ + ApiOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiOperation + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation"; + }; + + return ApiOperation; + })(); + + ServicePerimeterConfig.IngressSource = (function() { + + /** + * Properties of an IngressSource. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressSource + * @property {string|null} [accessLevel] IngressSource accessLevel + * @property {string|null} [resource] IngressSource resource + */ + + /** + * Constructs a new IngressSource. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressSource. + * @implements IIngressSource + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource=} [properties] Properties to set + */ + function IngressSource(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]]; + } + + /** + * IngressSource accessLevel. + * @member {string|null|undefined} accessLevel + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + IngressSource.prototype.accessLevel = null; + + /** + * IngressSource resource. + * @member {string|null|undefined} resource + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + IngressSource.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngressSource source. + * @member {"accessLevel"|"resource"|undefined} source + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + Object.defineProperty(IngressSource.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["accessLevel", "resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngressSource instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource instance + */ + IngressSource.create = function create(properties) { + return new IngressSource(properties); + }; + + /** + * Encodes the specified IngressSource message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource} message IngressSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessLevel); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + return writer; + }; + + /** + * Encodes the specified IngressSource message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource} message IngressSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressSource message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressSource.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessLevel = reader.string(); + break; + } + case 2: { + message.resource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressSource message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + properties.source = 1; + if (!$util.isString(message.accessLevel)) + return "accessLevel: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.resource)) + return "resource: string expected"; + } + return null; + }; + + /** + * Creates an IngressSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + */ + IngressSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource(); + if (object.accessLevel != null) + message.accessLevel = String(object.accessLevel); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from an IngressSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} message IngressSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = message.accessLevel; + if (options.oneofs) + object.source = "accessLevel"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = message.resource; + if (options.oneofs) + object.source = "resource"; + } + return object; + }; + + /** + * Converts this IngressSource to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + * @returns {Object.} JSON object + */ + IngressSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressSource + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource"; + }; + + return IngressSource; + })(); + + ServicePerimeterConfig.IngressFrom = (function() { + + /** + * Properties of an IngressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressFrom + * @property {Array.|null} [sources] IngressFrom sources + * @property {Array.|null} [identities] IngressFrom identities + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null} [identityType] IngressFrom identityType + */ + + /** + * Constructs a new IngressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressFrom. + * @implements IIngressFrom + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom=} [properties] Properties to set + */ + function IngressFrom(properties) { + this.sources = []; + this.identities = []; + 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]]; + } + + /** + * IngressFrom sources. + * @member {Array.} sources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.sources = $util.emptyArray; + + /** + * IngressFrom identities. + * @member {Array.} identities + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.identities = $util.emptyArray; + + /** + * IngressFrom identityType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType} identityType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.identityType = 0; + + /** + * Creates a new IngressFrom instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom instance + */ + IngressFrom.create = function create(properties) { + return new IngressFrom(properties); + }; + + /** + * Encodes the specified IngressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom} message IngressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressFrom.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.identities[i]); + if (message.identityType != null && Object.hasOwnProperty.call(message, "identityType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.identityType); + return writer; + }; + + /** + * Encodes the specified IngressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom} message IngressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressFrom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressFrom message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressFrom.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.string()); + break; + } + case 3: { + message.identityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressFrom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressFrom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressFrom message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressFrom.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + 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) + if (!$util.isString(message.identities[i])) + return "identities: string[] expected"; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + switch (message.identityType) { + default: + return "identityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an IngressFrom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + */ + IngressFrom.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.sources: object expected"); + message.sources[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.fromObject(object.sources[i]); + } + } + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + message.identities[i] = String(object.identities[i]); + } + switch (object.identityType) { + default: + if (typeof object.identityType === "number") { + message.identityType = object.identityType; + break; + } + break; + case "IDENTITY_TYPE_UNSPECIFIED": + case 0: + message.identityType = 0; + break; + case "ANY_IDENTITY": + case 1: + message.identityType = 1; + break; + case "ANY_USER_ACCOUNT": + case 2: + message.identityType = 2; + break; + case "ANY_SERVICE_ACCOUNT": + case 3: + message.identityType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an IngressFrom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} message IngressFrom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressFrom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.identities = []; + } + if (options.defaults) + object.identityType = options.enums === String ? "IDENTITY_TYPE_UNSPECIFIED" : 0; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.toObject(message.sources[j], options); + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = message.identities[j]; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + object.identityType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] === undefined ? message.identityType : $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] : message.identityType; + return object; + }; + + /** + * Converts this IngressFrom to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + * @returns {Object.} JSON object + */ + IngressFrom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressFrom + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressFrom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom"; + }; + + return IngressFrom; + })(); + + ServicePerimeterConfig.IngressTo = (function() { + + /** + * Properties of an IngressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressTo + * @property {Array.|null} [operations] IngressTo operations + * @property {Array.|null} [resources] IngressTo resources + */ + + /** + * Constructs a new IngressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressTo. + * @implements IIngressTo + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo=} [properties] Properties to set + */ + function IngressTo(properties) { + this.operations = []; + this.resources = []; + 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]]; + } + + /** + * IngressTo operations. + * @member {Array.} operations + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + */ + IngressTo.prototype.operations = $util.emptyArray; + + /** + * IngressTo resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + */ + IngressTo.prototype.resources = $util.emptyArray; + + /** + * Creates a new IngressTo instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo instance + */ + IngressTo.create = function create(properties) { + return new IngressTo(properties); + }; + + /** + * Encodes the specified IngressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo} message IngressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressTo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resources[i]); + return writer; + }; + + /** + * Encodes the specified IngressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo} message IngressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressTo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressTo message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressTo.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressTo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressTo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressTo message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressTo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + 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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + return null; + }; + + /** + * Creates an IngressTo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + */ + IngressTo.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.operations: object expected"); + message.operations[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.fromObject(object.operations[i]); + } + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + return message; + }; + + /** + * Creates a plain object from an IngressTo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} message IngressTo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressTo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.operations = []; + object.resources = []; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.toObject(message.operations[j], options); + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + return object; + }; + + /** + * Converts this IngressTo to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + * @returns {Object.} JSON object + */ + IngressTo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressTo + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressTo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo"; + }; + + return IngressTo; + })(); + + ServicePerimeterConfig.IngressPolicy = (function() { + + /** + * Properties of an IngressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressPolicy + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null} [ingressFrom] IngressPolicy ingressFrom + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null} [ingressTo] IngressPolicy ingressTo + */ + + /** + * Constructs a new IngressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressPolicy. + * @implements IIngressPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy=} [properties] Properties to set + */ + function IngressPolicy(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]]; + } + + /** + * IngressPolicy ingressFrom. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null|undefined} ingressFrom + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + */ + IngressPolicy.prototype.ingressFrom = null; + + /** + * IngressPolicy ingressTo. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null|undefined} ingressTo + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + */ + IngressPolicy.prototype.ingressTo = null; + + /** + * Creates a new IngressPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy instance + */ + IngressPolicy.create = function create(properties) { + return new IngressPolicy(properties); + }; + + /** + * Encodes the specified IngressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy} message IngressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingressFrom != null && Object.hasOwnProperty.call(message, "ingressFrom")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.encode(message.ingressFrom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ingressTo != null && Object.hasOwnProperty.call(message, "ingressTo")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.encode(message.ingressTo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy} message IngressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressPolicy.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ingressFrom != null && message.hasOwnProperty("ingressFrom")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify(message.ingressFrom); + if (error) + return "ingressFrom." + error; + } + if (message.ingressTo != null && message.hasOwnProperty("ingressTo")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify(message.ingressTo); + if (error) + return "ingressTo." + error; + } + return null; + }; + + /** + * Creates an IngressPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + */ + IngressPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy(); + if (object.ingressFrom != null) { + if (typeof object.ingressFrom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.ingressFrom: object expected"); + message.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.fromObject(object.ingressFrom); + } + if (object.ingressTo != null) { + if (typeof object.ingressTo !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.ingressTo: object expected"); + message.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.fromObject(object.ingressTo); + } + return message; + }; + + /** + * Creates a plain object from an IngressPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} message IngressPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ingressFrom = null; + object.ingressTo = null; + } + if (message.ingressFrom != null && message.hasOwnProperty("ingressFrom")) + object.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.toObject(message.ingressFrom, options); + if (message.ingressTo != null && message.hasOwnProperty("ingressTo")) + object.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.toObject(message.ingressTo, options); + return object; + }; + + /** + * Converts this IngressPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + * @returns {Object.} JSON object + */ + IngressPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy"; + }; + + return IngressPolicy; + })(); + + ServicePerimeterConfig.EgressFrom = (function() { + + /** + * Properties of an EgressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressFrom + * @property {Array.|null} [identities] EgressFrom identities + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null} [identityType] EgressFrom identityType + */ + + /** + * Constructs a new EgressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressFrom. + * @implements IEgressFrom + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom=} [properties] Properties to set + */ + function EgressFrom(properties) { + this.identities = []; + 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]]; + } + + /** + * EgressFrom identities. + * @member {Array.} identities + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + */ + EgressFrom.prototype.identities = $util.emptyArray; + + /** + * EgressFrom identityType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType} identityType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + */ + EgressFrom.prototype.identityType = 0; + + /** + * Creates a new EgressFrom instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom instance + */ + EgressFrom.create = function create(properties) { + return new EgressFrom(properties); + }; + + /** + * Encodes the specified EgressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom} message EgressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressFrom.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identities[i]); + if (message.identityType != null && Object.hasOwnProperty.call(message, "identityType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.identityType); + return writer; + }; + + /** + * Encodes the specified EgressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom} message EgressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressFrom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressFrom message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressFrom.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.string()); + break; + } + case 2: { + message.identityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressFrom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressFrom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressFrom message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressFrom.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) + if (!$util.isString(message.identities[i])) + return "identities: string[] expected"; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + switch (message.identityType) { + default: + return "identityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an EgressFrom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + */ + EgressFrom.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + message.identities[i] = String(object.identities[i]); + } + switch (object.identityType) { + default: + if (typeof object.identityType === "number") { + message.identityType = object.identityType; + break; + } + break; + case "IDENTITY_TYPE_UNSPECIFIED": + case 0: + message.identityType = 0; + break; + case "ANY_IDENTITY": + case 1: + message.identityType = 1; + break; + case "ANY_USER_ACCOUNT": + case 2: + message.identityType = 2; + break; + case "ANY_SERVICE_ACCOUNT": + case 3: + message.identityType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an EgressFrom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} message EgressFrom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressFrom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identities = []; + if (options.defaults) + object.identityType = options.enums === String ? "IDENTITY_TYPE_UNSPECIFIED" : 0; + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = message.identities[j]; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + object.identityType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] === undefined ? message.identityType : $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] : message.identityType; + return object; + }; + + /** + * Converts this EgressFrom to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + * @returns {Object.} JSON object + */ + EgressFrom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressFrom + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressFrom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom"; + }; + + return EgressFrom; + })(); + + ServicePerimeterConfig.EgressTo = (function() { + + /** + * Properties of an EgressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressTo + * @property {Array.|null} [resources] EgressTo resources + * @property {Array.|null} [operations] EgressTo operations + * @property {Array.|null} [externalResources] EgressTo externalResources + */ + + /** + * Constructs a new EgressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressTo. + * @implements IEgressTo + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo=} [properties] Properties to set + */ + function EgressTo(properties) { + this.resources = []; + this.operations = []; + this.externalResources = []; + 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]]; + } + + /** + * EgressTo resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.resources = $util.emptyArray; + + /** + * EgressTo operations. + * @member {Array.} operations + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.operations = $util.emptyArray; + + /** + * EgressTo externalResources. + * @member {Array.} externalResources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.externalResources = $util.emptyArray; + + /** + * Creates a new EgressTo instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo instance + */ + EgressTo.create = function create(properties) { + return new EgressTo(properties); + }; + + /** + * Encodes the specified EgressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo} message EgressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressTo.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.encode(message.operations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.externalResources != null && message.externalResources.length) + for (var i = 0; i < message.externalResources.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalResources[i]); + return writer; + }; + + /** + * Encodes the specified EgressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo} message EgressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressTo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressTo message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressTo.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.externalResources && message.externalResources.length)) + message.externalResources = []; + message.externalResources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressTo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressTo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressTo message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressTo.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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.externalResources != null && message.hasOwnProperty("externalResources")) { + if (!Array.isArray(message.externalResources)) + return "externalResources: array expected"; + for (var i = 0; i < message.externalResources.length; ++i) + if (!$util.isString(message.externalResources[i])) + return "externalResources: string[] expected"; + } + return null; + }; + + /** + * Creates an EgressTo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + */ + EgressTo.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.operations: object expected"); + message.operations[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.fromObject(object.operations[i]); + } + } + if (object.externalResources) { + if (!Array.isArray(object.externalResources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.externalResources: array expected"); + message.externalResources = []; + for (var i = 0; i < object.externalResources.length; ++i) + message.externalResources[i] = String(object.externalResources[i]); + } + return message; + }; + + /** + * Creates a plain object from an EgressTo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} message EgressTo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressTo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.operations = []; + object.externalResources = []; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.toObject(message.operations[j], options); + } + if (message.externalResources && message.externalResources.length) { + object.externalResources = []; + for (var j = 0; j < message.externalResources.length; ++j) + object.externalResources[j] = message.externalResources[j]; + } + return object; + }; + + /** + * Converts this EgressTo to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + * @returns {Object.} JSON object + */ + EgressTo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressTo + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressTo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo"; + }; + + return EgressTo; + })(); + + ServicePerimeterConfig.EgressPolicy = (function() { + + /** + * Properties of an EgressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressPolicy + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null} [egressFrom] EgressPolicy egressFrom + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null} [egressTo] EgressPolicy egressTo + */ + + /** + * Constructs a new EgressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressPolicy. + * @implements IEgressPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy=} [properties] Properties to set + */ + function EgressPolicy(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]]; + } + + /** + * EgressPolicy egressFrom. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null|undefined} egressFrom + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + */ + EgressPolicy.prototype.egressFrom = null; + + /** + * EgressPolicy egressTo. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null|undefined} egressTo + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + */ + EgressPolicy.prototype.egressTo = null; + + /** + * Creates a new EgressPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy instance + */ + EgressPolicy.create = function create(properties) { + return new EgressPolicy(properties); + }; + + /** + * Encodes the specified EgressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy} message EgressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.egressFrom != null && Object.hasOwnProperty.call(message, "egressFrom")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.encode(message.egressFrom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.egressTo != null && Object.hasOwnProperty.call(message, "egressTo")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.encode(message.egressTo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EgressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy} message EgressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressPolicy.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.decode(reader, reader.uint32()); + break; + } + case 2: { + message.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.egressFrom != null && message.hasOwnProperty("egressFrom")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify(message.egressFrom); + if (error) + return "egressFrom." + error; + } + if (message.egressTo != null && message.hasOwnProperty("egressTo")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify(message.egressTo); + if (error) + return "egressTo." + error; + } + return null; + }; + + /** + * Creates an EgressPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + */ + EgressPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy(); + if (object.egressFrom != null) { + if (typeof object.egressFrom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.egressFrom: object expected"); + message.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.fromObject(object.egressFrom); + } + if (object.egressTo != null) { + if (typeof object.egressTo !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.egressTo: object expected"); + message.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.fromObject(object.egressTo); + } + return message; + }; + + /** + * Creates a plain object from an EgressPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} message EgressPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.egressFrom = null; + object.egressTo = null; + } + if (message.egressFrom != null && message.hasOwnProperty("egressFrom")) + object.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.toObject(message.egressFrom, options); + if (message.egressTo != null && message.hasOwnProperty("egressTo")) + object.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.toObject(message.egressTo, options); + return object; + }; + + /** + * Converts this EgressPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + * @returns {Object.} JSON object + */ + EgressPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy"; + }; + + return EgressPolicy; + })(); + + return ServicePerimeterConfig; + })(); + + return v1; + })(); + + accesscontextmanager.type = (function() { + + /** + * Namespace type. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var type = {}; + + /** + * DeviceEncryptionStatus enum. + * @name google.identity.accesscontextmanager.type.DeviceEncryptionStatus + * @enum {number} + * @property {number} ENCRYPTION_UNSPECIFIED=0 ENCRYPTION_UNSPECIFIED value + * @property {number} ENCRYPTION_UNSUPPORTED=1 ENCRYPTION_UNSUPPORTED value + * @property {number} UNENCRYPTED=2 UNENCRYPTED value + * @property {number} ENCRYPTED=3 ENCRYPTED value + */ + type.DeviceEncryptionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENCRYPTION_UNSUPPORTED"] = 1; + values[valuesById[2] = "UNENCRYPTED"] = 2; + values[valuesById[3] = "ENCRYPTED"] = 3; + return values; + })(); + + /** + * OsType enum. + * @name google.identity.accesscontextmanager.type.OsType + * @enum {number} + * @property {number} OS_UNSPECIFIED=0 OS_UNSPECIFIED value + * @property {number} DESKTOP_MAC=1 DESKTOP_MAC value + * @property {number} DESKTOP_WINDOWS=2 DESKTOP_WINDOWS value + * @property {number} DESKTOP_LINUX=3 DESKTOP_LINUX value + * @property {number} DESKTOP_CHROME_OS=6 DESKTOP_CHROME_OS value + * @property {number} ANDROID=4 ANDROID value + * @property {number} IOS=5 IOS value + */ + type.OsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OS_UNSPECIFIED"] = 0; + values[valuesById[1] = "DESKTOP_MAC"] = 1; + values[valuesById[2] = "DESKTOP_WINDOWS"] = 2; + values[valuesById[3] = "DESKTOP_LINUX"] = 3; + values[valuesById[6] = "DESKTOP_CHROME_OS"] = 6; + values[valuesById[4] = "ANDROID"] = 4; + values[valuesById[5] = "IOS"] = 5; + return values; + })(); + + /** + * DeviceManagementLevel enum. + * @name google.identity.accesscontextmanager.type.DeviceManagementLevel + * @enum {number} + * @property {number} MANAGEMENT_UNSPECIFIED=0 MANAGEMENT_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} BASIC=2 BASIC value + * @property {number} COMPLETE=3 COMPLETE value + */ + type.DeviceManagementLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANAGEMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "BASIC"] = 2; + values[valuesById[3] = "COMPLETE"] = 3; + return values; + })(); + + return type; + })(); + + return accesscontextmanager; + })(); + + return identity; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + /** + * Code enum. + * @name google.rpc.Code + * @enum {number} + * @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; + })(); + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + 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]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.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.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @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 Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.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.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(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]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.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.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(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]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.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.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + 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]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.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.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.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.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(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]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.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.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(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]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.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.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(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]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.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.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-asset/v1/protos/protos.json b/owl-bot-staging/google-cloud-asset/v1/protos/protos.json new file mode 100644 index 00000000000..146ec84d91e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/protos/protos.json @@ -0,0 +1,6485 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "asset": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1", + "go_package": "cloud.google.com/go/asset/apiv1/assetpb;assetpb", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1", + "php_namespace": "Google\\Cloud\\Asset\\V1", + "cc_enable_arenas": true + }, + "nested": { + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ExportAssets": { + "requestType": "ExportAssetsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}:exportAssets", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.ExportAssetsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.ExportAssetsRequest" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}:exportAssets", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.asset.v1.ExportAssetsResponse", + "metadata_type": "google.cloud.asset.v1.ExportAssetsRequest" + } + } + ] + }, + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}/assets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}/assets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "BatchGetAssetsHistory": { + "requestType": "BatchGetAssetsHistoryRequest", + "responseType": "BatchGetAssetsHistoryResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}:batchGetAssetsHistory" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}:batchGetAssetsHistory" + } + } + ] + }, + "CreateFeed": { + "requestType": "CreateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}/feeds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}/feeds", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetFeed": { + "requestType": "GetFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).get": "/v1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=*/*/feeds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListFeeds": { + "requestType": "ListFeedsRequest", + "responseType": "ListFeedsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}/feeds", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}/feeds" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateFeed": { + "requestType": "UpdateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).patch": "/v1/{feed.name=*/*/feeds/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "feed" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{feed.name=*/*/feeds/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "feed" + } + ] + }, + "DeleteFeed": { + "requestType": "DeleteFeedRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=*/*/feeds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "SearchAllResources": { + "requestType": "SearchAllResourcesRequest", + "responseType": "SearchAllResourcesResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}:searchAllResources", + "(google.api.method_signature)": "scope,query,asset_types" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}:searchAllResources" + } + }, + { + "(google.api.method_signature)": "scope,query,asset_types" + } + ] + }, + "SearchAllIamPolicies": { + "requestType": "SearchAllIamPoliciesRequest", + "responseType": "SearchAllIamPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}:searchAllIamPolicies", + "(google.api.method_signature)": "scope,query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}:searchAllIamPolicies" + } + }, + { + "(google.api.method_signature)": "scope,query" + } + ] + }, + "AnalyzeIamPolicy": { + "requestType": "AnalyzeIamPolicyRequest", + "responseType": "AnalyzeIamPolicyResponse", + "options": { + "(google.api.http).get": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicy" + } + } + ] + }, + "AnalyzeIamPolicyLongrunning": { + "requestType": "AnalyzeIamPolicyLongrunningRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{analysis_query.scope=*/*}:analyzeIamPolicyLongrunning", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse", + "metadata_type": "google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata" + } + } + ] + }, + "AnalyzeMove": { + "requestType": "AnalyzeMoveRequest", + "responseType": "AnalyzeMoveResponse", + "options": { + "(google.api.http).get": "/v1/{resource=*/*}:analyzeMove" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{resource=*/*}:analyzeMove" + } + } + ] + }, + "QueryAssets": { + "requestType": "QueryAssetsRequest", + "responseType": "QueryAssetsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}:queryAssets", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}:queryAssets", + "body": "*" + } + } + ] + }, + "CreateSavedQuery": { + "requestType": "CreateSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).post": "/v1/{parent=*/*}/savedQueries", + "(google.api.http).body": "saved_query", + "(google.api.method_signature)": "parent,saved_query,saved_query_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=*/*}/savedQueries", + "body": "saved_query" + } + }, + { + "(google.api.method_signature)": "parent,saved_query,saved_query_id" + } + ] + }, + "GetSavedQuery": { + "requestType": "GetSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).get": "/v1/{name=*/*/savedQueries/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=*/*/savedQueries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListSavedQueries": { + "requestType": "ListSavedQueriesRequest", + "responseType": "ListSavedQueriesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=*/*}/savedQueries", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=*/*}/savedQueries" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateSavedQuery": { + "requestType": "UpdateSavedQueryRequest", + "responseType": "SavedQuery", + "options": { + "(google.api.http).patch": "/v1/{saved_query.name=*/*/savedQueries/*}", + "(google.api.http).body": "saved_query", + "(google.api.method_signature)": "saved_query,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{saved_query.name=*/*/savedQueries/*}", + "body": "saved_query" + } + }, + { + "(google.api.method_signature)": "saved_query,update_mask" + } + ] + }, + "DeleteSavedQuery": { + "requestType": "DeleteSavedQueryRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=*/*/savedQueries/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=*/*/savedQueries/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchGetEffectiveIamPolicies": { + "requestType": "BatchGetEffectiveIamPoliciesRequest", + "responseType": "BatchGetEffectiveIamPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}/effectiveIamPolicies:batchGet" + } + } + ] + }, + "AnalyzeOrgPolicies": { + "requestType": "AnalyzeOrgPoliciesRequest", + "responseType": "AnalyzeOrgPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}:analyzeOrgPolicies", + "(google.api.method_signature)": "scope,constraint,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}:analyzeOrgPolicies" + } + }, + { + "(google.api.method_signature)": "scope,constraint,filter" + } + ] + }, + "AnalyzeOrgPolicyGovernedContainers": { + "requestType": "AnalyzeOrgPolicyGovernedContainersRequest", + "responseType": "AnalyzeOrgPolicyGovernedContainersResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}:analyzeOrgPolicyGovernedContainers", + "(google.api.method_signature)": "scope,constraint,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}:analyzeOrgPolicyGovernedContainers" + } + }, + { + "(google.api.method_signature)": "scope,constraint,filter" + } + ] + }, + "AnalyzeOrgPolicyGovernedAssets": { + "requestType": "AnalyzeOrgPolicyGovernedAssetsRequest", + "responseType": "AnalyzeOrgPolicyGovernedAssetsResponse", + "options": { + "(google.api.http).get": "/v1/{scope=*/*}:analyzeOrgPolicyGovernedAssets", + "(google.api.method_signature)": "scope,constraint,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{scope=*/*}:analyzeOrgPolicyGovernedAssets" + } + }, + { + "(google.api.method_signature)": "scope,constraint,filter" + } + ] + } + } + }, + "AnalyzeIamPolicyLongrunningMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ExportAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "ExportAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 2 + }, + "outputResult": { + "type": "OutputResult", + "id": 3 + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 7 + } + } + }, + "ListAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "assets": { + "rule": "repeated", + "type": "Asset", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "BatchGetAssetsHistoryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } + }, + "assetNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "contentType": { + "type": "ContentType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readTimeWindow": { + "type": "TimeWindow", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchGetAssetsHistoryResponse": { + "fields": { + "assets": { + "rule": "repeated", + "type": "TemporalAsset", + "id": 1 + } + } + }, + "CreateFeedRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feedId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feed": { + "type": "Feed", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetFeedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } + } + } + }, + "ListFeedsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListFeedsResponse": { + "fields": { + "feeds": { + "rule": "repeated", + "type": "Feed", + "id": 1 + } + } + }, + "UpdateFeedRequest": { + "fields": { + "feed": { + "type": "Feed", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteFeedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + } + }, + "OutputResult": { + "oneofs": { + "result": { + "oneof": [ + "gcsResult" + ] + } + }, + "fields": { + "gcsResult": { + "type": "GcsOutputResult", + "id": 1 + } + } + }, + "GcsOutputResult": { + "fields": { + "uris": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GcsDestination": { + "oneofs": { + "objectUri": { + "oneof": [ + "uri", + "uriPrefix" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "uriPrefix": { + "type": "string", + "id": 2 + } + } + }, + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 3 + }, + "partitionSpec": { + "type": "PartitionSpec", + "id": 4 + }, + "separateTablesPerAssetType": { + "type": "bool", + "id": 5 + } + } + }, + "PartitionSpec": { + "fields": { + "partitionKey": { + "type": "PartitionKey", + "id": 1 + } + }, + "nested": { + "PartitionKey": { + "values": { + "PARTITION_KEY_UNSPECIFIED": 0, + "READ_TIME": 1, + "REQUEST_TIME": 2 + } + } + } + }, + "PubsubDestination": { + "fields": { + "topic": { + "type": "string", + "id": 1 + } + } + }, + "FeedOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "pubsubDestination" + ] + } + }, + "fields": { + "pubsubDestination": { + "type": "PubsubDestination", + "id": 1 + } + } + }, + "Feed": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Feed", + "(google.api.resource).pattern": "organizations/{organization}/feeds/{feed}", + "(google.api.resource).history": "ORIGINALLY_SINGLE_PATTERN" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "assetNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "feedOutputConfig": { + "type": "FeedOutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "condition": { + "type": "google.type.Expr", + "id": 6 + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 7 + } + } + }, + "SearchAllResourcesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readMask": { + "type": "google.protobuf.FieldMask", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchAllResourcesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "ResourceSearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchAllIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchAllIamPoliciesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "IamPolicySearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "IamPolicyAnalysisQuery": { + "fields": { + "scope": { + "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" + } + }, + "options": { + "type": "Options", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "conditionContext": { + "type": "ConditionContext", + "id": 6, + "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" + } + } + } + }, + "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" + } + } + } + }, + "ConditionContext": { + "oneofs": { + "TimeContext": { + "oneof": [ + "accessTime" + ] + } + }, + "fields": { + "accessTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } + } + } + }, + "AnalyzeIamPolicyRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "savedAnalysisQuery": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "executionTimeout": { + "type": "google.protobuf.Duration", + "id": 2, + "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 + } + }, + "nested": { + "IamPolicyAnalysis": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1 + }, + "analysisResults": { + "rule": "repeated", + "type": "IamPolicyAnalysisResult", + "id": 2 + }, + "fullyExplored": { + "type": "bool", + "id": 3 + }, + "nonCriticalErrors": { + "rule": "repeated", + "type": "IamPolicyAnalysisState", + "id": 5 + } + } + } + } + }, + "IamPolicyAnalysisOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + }, + "nested": { + "GcsDestination": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tablePrefix": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "partitionKey": { + "type": "PartitionKey", + "id": 3 + }, + "writeDisposition": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PartitionKey": { + "values": { + "PARTITION_KEY_UNSPECIFIED": 0, + "REQUEST_TIME": 1 + } + } + } + } + } + }, + "AnalyzeIamPolicyLongrunningRequest": { + "fields": { + "analysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "savedAnalysisQuery": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputConfig": { + "type": "IamPolicyAnalysisOutputConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "AnalyzeIamPolicyLongrunningResponse": { + "fields": {} + }, + "SavedQuery": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/SavedQuery", + "(google.api.resource).pattern": "organizations/{organization}/savedQueries/{saved_query}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "creator": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdater": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "content": { + "type": "QueryContent", + "id": 8 + } + }, + "nested": { + "QueryContent": { + "oneofs": { + "queryContent": { + "oneof": [ + "iamPolicyAnalysisQuery" + ] + } + }, + "fields": { + "iamPolicyAnalysisQuery": { + "type": "IamPolicyAnalysisQuery", + "id": 1 + } + } + } + } + }, + "CreateSavedQueryRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/SavedQuery" + } + }, + "savedQuery": { + "type": "SavedQuery", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "savedQueryId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSavedQueryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/SavedQuery" + } + } + } + }, + "ListSavedQueriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/SavedQuery" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSavedQueriesResponse": { + "fields": { + "savedQueries": { + "rule": "repeated", + "type": "SavedQuery", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateSavedQueryRequest": { + "fields": { + "savedQuery": { + "type": "SavedQuery", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteSavedQueryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/SavedQuery" + } + } + } + }, + "AnalyzeMoveRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "destinationParent": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "view": { + "type": "AnalysisView", + "id": 3 + } + }, + "nested": { + "AnalysisView": { + "values": { + "ANALYSIS_VIEW_UNSPECIFIED": 0, + "FULL": 1, + "BASIC": 2 + } + } + } + }, + "AnalyzeMoveResponse": { + "fields": { + "moveAnalysis": { + "rule": "repeated", + "type": "MoveAnalysis", + "id": 1 + } + } + }, + "MoveAnalysis": { + "oneofs": { + "result": { + "oneof": [ + "analysis", + "error" + ] + } + }, + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "analysis": { + "type": "MoveAnalysisResult", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 3 + } + } + }, + "MoveAnalysisResult": { + "fields": { + "blockers": { + "rule": "repeated", + "type": "MoveImpact", + "id": 1 + }, + "warnings": { + "rule": "repeated", + "type": "MoveImpact", + "id": 2 + } + } + }, + "MoveImpact": { + "fields": { + "detail": { + "type": "string", + "id": 1 + } + } + }, + "QueryAssetsOutputConfig": { + "fields": { + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 1 + } + }, + "nested": { + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "writeDisposition": { + "type": "string", + "id": 3 + } + } + } + } + }, + "QueryAssetsRequest": { + "oneofs": { + "query": { + "oneof": [ + "statement", + "jobReference" + ] + }, + "time": { + "oneof": [ + "readTimeWindow", + "readTime" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } + }, + "statement": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "jobReference": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readTimeWindow": { + "type": "TimeWindow", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "outputConfig": { + "type": "QueryAssetsOutputConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryAssetsResponse": { + "oneofs": { + "response": { + "oneof": [ + "error", + "queryResult", + "outputConfig" + ] + } + }, + "fields": { + "jobReference": { + "type": "string", + "id": 1 + }, + "done": { + "type": "bool", + "id": 2 + }, + "error": { + "type": "google.rpc.Status", + "id": 3 + }, + "queryResult": { + "type": "QueryResult", + "id": 4 + }, + "outputConfig": { + "type": "QueryAssetsOutputConfig", + "id": 5 + } + } + }, + "QueryResult": { + "fields": { + "rows": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 1 + }, + "schema": { + "type": "TableSchema", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + }, + "totalRows": { + "type": "int64", + "id": 4 + } + } + }, + "TableSchema": { + "fields": { + "fields": { + "rule": "repeated", + "type": "TableFieldSchema", + "id": 1 + } + } + }, + "TableFieldSchema": { + "fields": { + "field": { + "type": "string", + "id": 1 + }, + "type": { + "type": "string", + "id": 2 + }, + "mode": { + "type": "string", + "id": 3 + }, + "fields": { + "rule": "repeated", + "type": "TableFieldSchema", + "id": 4 + } + } + }, + "BatchGetEffectiveIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "*" + } + }, + "names": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + } + } + }, + "BatchGetEffectiveIamPoliciesResponse": { + "fields": { + "policyResults": { + "rule": "repeated", + "type": "EffectiveIamPolicy", + "id": 2 + } + }, + "nested": { + "EffectiveIamPolicy": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "policies": { + "rule": "repeated", + "type": "PolicyInfo", + "id": 2 + } + }, + "nested": { + "PolicyInfo": { + "fields": { + "attachedResource": { + "type": "string", + "id": 1 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 2 + } + } + } + } + } + } + }, + "AnalyzerOrgPolicy": { + "fields": { + "attachedResource": { + "type": "string", + "id": 1 + }, + "appliedResource": { + "type": "string", + "id": 5 + }, + "rules": { + "rule": "repeated", + "type": "Rule", + "id": 2 + }, + "inheritFromParent": { + "type": "bool", + "id": 3 + }, + "reset": { + "type": "bool", + "id": 4 + } + }, + "nested": { + "Rule": { + "oneofs": { + "kind": { + "oneof": [ + "values", + "allowAll", + "denyAll", + "enforce" + ] + } + }, + "fields": { + "values": { + "type": "StringValues", + "id": 3 + }, + "allowAll": { + "type": "bool", + "id": 4 + }, + "denyAll": { + "type": "bool", + "id": 5 + }, + "enforce": { + "type": "bool", + "id": 6 + }, + "condition": { + "type": "google.type.Expr", + "id": 7 + }, + "conditionEvaluation": { + "type": "ConditionEvaluation", + "id": 8 + } + }, + "nested": { + "StringValues": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "deniedValues": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + } + } + } + } + }, + "AnalyzerOrgPolicyConstraint": { + "oneofs": { + "constraintDefinition": { + "oneof": [ + "googleDefinedConstraint", + "customConstraint" + ] + } + }, + "fields": { + "googleDefinedConstraint": { + "type": "Constraint", + "id": 1 + }, + "customConstraint": { + "type": "CustomConstraint", + "id": 2 + } + }, + "nested": { + "Constraint": { + "oneofs": { + "constraintType": { + "oneof": [ + "listConstraint", + "booleanConstraint" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "constraintDefault": { + "type": "ConstraintDefault", + "id": 4 + }, + "listConstraint": { + "type": "ListConstraint", + "id": 5 + }, + "booleanConstraint": { + "type": "BooleanConstraint", + "id": 6 + } + }, + "nested": { + "ConstraintDefault": { + "values": { + "CONSTRAINT_DEFAULT_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 + } + }, + "ListConstraint": { + "fields": { + "supportsIn": { + "type": "bool", + "id": 1 + }, + "supportsUnder": { + "type": "bool", + "id": 2 + } + } + }, + "BooleanConstraint": { + "fields": {} + } + } + }, + "CustomConstraint": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "resourceTypes": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "methodTypes": { + "rule": "repeated", + "type": "MethodType", + "id": 3 + }, + "condition": { + "type": "string", + "id": 4 + }, + "actionType": { + "type": "ActionType", + "id": 5 + }, + "displayName": { + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + } + }, + "nested": { + "MethodType": { + "values": { + "METHOD_TYPE_UNSPECIFIED": 0, + "CREATE": 1, + "UPDATE": 2, + "DELETE": 3 + } + }, + "ActionType": { + "values": { + "ACTION_TYPE_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 + } + } + } + } + } + }, + "AnalyzeOrgPoliciesRequest": { + "oneofs": { + "_pageSize": { + "oneof": [ + "pageSize" + ] + } + }, + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "constraint": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "AnalyzeOrgPoliciesResponse": { + "fields": { + "orgPolicyResults": { + "rule": "repeated", + "type": "OrgPolicyResult", + "id": 1 + }, + "constraint": { + "type": "AnalyzerOrgPolicyConstraint", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + }, + "nested": { + "OrgPolicyResult": { + "fields": { + "consolidatedPolicy": { + "type": "AnalyzerOrgPolicy", + "id": 1 + }, + "policyBundle": { + "rule": "repeated", + "type": "AnalyzerOrgPolicy", + "id": 2 + }, + "project": { + "type": "string", + "id": 3 + }, + "folders": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "organization": { + "type": "string", + "id": 5 + } + } + } + } + }, + "AnalyzeOrgPolicyGovernedContainersRequest": { + "oneofs": { + "_pageSize": { + "oneof": [ + "pageSize" + ] + } + }, + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "constraint": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "AnalyzeOrgPolicyGovernedContainersResponse": { + "fields": { + "governedContainers": { + "rule": "repeated", + "type": "GovernedContainer", + "id": 1 + }, + "constraint": { + "type": "AnalyzerOrgPolicyConstraint", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + }, + "nested": { + "GovernedContainer": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "consolidatedPolicy": { + "type": "AnalyzerOrgPolicy", + "id": 3 + }, + "policyBundle": { + "rule": "repeated", + "type": "AnalyzerOrgPolicy", + "id": 4 + }, + "project": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "organization": { + "type": "string", + "id": 7 + }, + "effectiveTags": { + "rule": "repeated", + "type": "EffectiveTagDetails", + "id": 8 + } + } + } + } + }, + "AnalyzeOrgPolicyGovernedAssetsRequest": { + "oneofs": { + "_pageSize": { + "oneof": [ + "pageSize" + ] + } + }, + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "constraint": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "filter": { + "type": "string", + "id": 3 + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "pageToken": { + "type": "string", + "id": 5 + } + } + }, + "AnalyzeOrgPolicyGovernedAssetsResponse": { + "fields": { + "governedAssets": { + "rule": "repeated", + "type": "GovernedAsset", + "id": 1 + }, + "constraint": { + "type": "AnalyzerOrgPolicyConstraint", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + }, + "nested": { + "GovernedResource": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "project": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "organization": { + "type": "string", + "id": 7 + }, + "assetType": { + "type": "string", + "id": 8 + }, + "effectiveTags": { + "rule": "repeated", + "type": "EffectiveTagDetails", + "id": 9 + } + } + }, + "GovernedIamPolicy": { + "fields": { + "attachedResource": { + "type": "string", + "id": 1 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 2 + }, + "project": { + "type": "string", + "id": 5 + }, + "folders": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "organization": { + "type": "string", + "id": 7 + }, + "assetType": { + "type": "string", + "id": 8 + } + } + }, + "GovernedAsset": { + "oneofs": { + "governedAsset": { + "oneof": [ + "governedResource", + "governedIamPolicy" + ] + } + }, + "fields": { + "governedResource": { + "type": "GovernedResource", + "id": 1 + }, + "governedIamPolicy": { + "type": "GovernedIamPolicy", + "id": 2 + }, + "consolidatedPolicy": { + "type": "AnalyzerOrgPolicy", + "id": 3 + }, + "policyBundle": { + "rule": "repeated", + "type": "AnalyzerOrgPolicy", + "id": 4 + } + } + } + } + }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2, + "ORG_POLICY": 4, + "ACCESS_POLICY": 5, + "OS_INVENTORY": 6, + "RELATIONSHIP": 7 + } + }, + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + }, + "priorAssetState": { + "type": "PriorAssetState", + "id": 4 + }, + "priorAsset": { + "type": "Asset", + "id": 5 + } + }, + "nested": { + "PriorAssetState": { + "values": { + "PRIOR_ASSET_STATE_UNSPECIFIED": 0, + "PRESENT": 1, + "INVALID": 2, + "DOES_NOT_EXIST": 3, + "DELETED": 4 + } + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, + "oneofs": { + "accessContextPolicy": { + "oneof": [ + "accessPolicy", + "accessLevel", + "servicePerimeter" + ] + } + }, + "fields": { + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "orgPolicy": { + "rule": "repeated", + "type": "google.cloud.orgpolicy.v1.Policy", + "id": 6 + }, + "accessPolicy": { + "type": "google.identity.accesscontextmanager.v1.AccessPolicy", + "id": 7 + }, + "accessLevel": { + "type": "google.identity.accesscontextmanager.v1.AccessLevel", + "id": 8 + }, + "servicePerimeter": { + "type": "google.identity.accesscontextmanager.v1.ServicePerimeter", + "id": 9 + }, + "osInventory": { + "type": "google.cloud.osconfig.v1.Inventory", + "id": 12 + }, + "relatedAssets": { + "type": "RelatedAssets", + "id": 13, + "options": { + "deprecated": true + } + }, + "relatedAsset": { + "type": "RelatedAsset", + "id": 15 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 10 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "location": { + "type": "string", + "id": 8 + } + } + }, + "RelatedAssets": { + "options": { + "deprecated": true + }, + "fields": { + "relationshipAttributes": { + "type": "RelationshipAttributes", + "id": 1 + }, + "assets": { + "rule": "repeated", + "type": "RelatedAsset", + "id": 2 + } + } + }, + "RelationshipAttributes": { + "options": { + "deprecated": true + }, + "fields": { + "type": { + "type": "string", + "id": 4 + }, + "sourceResourceType": { + "type": "string", + "id": 1 + }, + "targetResourceType": { + "type": "string", + "id": 2 + }, + "action": { + "type": "string", + "id": 3 + } + } + }, + "RelatedAsset": { + "fields": { + "asset": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Asset" + } + }, + "assetType": { + "type": "string", + "id": 2 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "relationshipType": { + "type": "string", + "id": 4 + } + } + }, + "Tag": { + "oneofs": { + "_tagKey": { + "oneof": [ + "tagKey" + ] + }, + "_tagKeyId": { + "oneof": [ + "tagKeyId" + ] + }, + "_tagValue": { + "oneof": [ + "tagValue" + ] + }, + "_tagValueId": { + "oneof": [ + "tagValueId" + ] + } + }, + "fields": { + "tagKey": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "tagKeyId": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "tagValue": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "tagValueId": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, + "EffectiveTagDetails": { + "oneofs": { + "_attachedResource": { + "oneof": [ + "attachedResource" + ] + } + }, + "fields": { + "attachedResource": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "effectiveTags": { + "rule": "repeated", + "type": "Tag", + "id": 2 + } + } + }, + "ResourceSearchResult": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "project": { + "type": "string", + "id": 3 + }, + "folders": { + "rule": "repeated", + "type": "string", + "id": 17 + }, + "organization": { + "type": "string", + "id": 18 + }, + "displayName": { + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "location": { + "type": "string", + "id": 6 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 7 + }, + "networkTags": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "kmsKey": { + "type": "string", + "id": 10, + "options": { + "deprecated": true + } + }, + "kmsKeys": { + "rule": "repeated", + "type": "string", + "id": 28 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12 + }, + "state": { + "type": "string", + "id": 13 + }, + "additionalAttributes": { + "type": "google.protobuf.Struct", + "id": 9 + }, + "parentFullResourceName": { + "type": "string", + "id": 19 + }, + "versionedResources": { + "rule": "repeated", + "type": "VersionedResource", + "id": 16 + }, + "attachedResources": { + "rule": "repeated", + "type": "AttachedResource", + "id": 20 + }, + "relationships": { + "keyType": "string", + "type": "RelatedResources", + "id": 21 + }, + "tagKeys": { + "rule": "repeated", + "type": "string", + "id": 23, + "options": { + "deprecated": true + } + }, + "tagValues": { + "rule": "repeated", + "type": "string", + "id": 25, + "options": { + "deprecated": true + } + }, + "tagValueIds": { + "rule": "repeated", + "type": "string", + "id": 26, + "options": { + "deprecated": true + } + }, + "tags": { + "rule": "repeated", + "type": "Tag", + "id": 29 + }, + "effectiveTags": { + "rule": "repeated", + "type": "EffectiveTagDetails", + "id": 30 + }, + "parentAssetType": { + "type": "string", + "id": 103 + }, + "sccSecurityMarks": { + "keyType": "string", + "type": "string", + "id": 32 + } + } + }, + "VersionedResource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "resource": { + "type": "google.protobuf.Struct", + "id": 2 + } + } + }, + "AttachedResource": { + "fields": { + "assetType": { + "type": "string", + "id": 1 + }, + "versionedResources": { + "rule": "repeated", + "type": "VersionedResource", + "id": 3 + } + } + }, + "RelatedResources": { + "fields": { + "relatedResources": { + "rule": "repeated", + "type": "RelatedResource", + "id": 1 + } + } + }, + "RelatedResource": { + "fields": { + "assetType": { + "type": "string", + "id": 1 + }, + "fullResourceName": { + "type": "string", + "id": 2 + } + } + }, + "IamPolicySearchResult": { + "fields": { + "resource": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 5 + }, + "project": { + "type": "string", + "id": 2 + }, + "folders": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "organization": { + "type": "string", + "id": 7 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 3 + }, + "explanation": { + "type": "Explanation", + "id": 4 + } + }, + "nested": { + "Explanation": { + "fields": { + "matchedPermissions": { + "keyType": "string", + "type": "Permissions", + "id": 1 + } + }, + "nested": { + "Permissions": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + } + } + }, + "IamPolicyAnalysisState": { + "fields": { + "code": { + "type": "google.rpc.Code", + "id": 1 + }, + "cause": { + "type": "string", + "id": 2 + } + } + }, + "ConditionEvaluation": { + "fields": { + "evaluationValue": { + "type": "EvaluationValue", + "id": 1 + } + }, + "nested": { + "EvaluationValue": { + "values": { + "EVALUATION_VALUE_UNSPECIFIED": 0, + "TRUE": 1, + "FALSE": 2, + "CONDITIONAL": 3 + } + } + } + }, + "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": { + "Resource": { + "fields": { + "fullResourceName": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 2 + } + } + }, + "Access": { + "oneofs": { + "oneofAccess": { + "oneof": [ + "role", + "permission" + ] + } + }, + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 3 + } + } + }, + "Identity": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "analysisState": { + "type": "IamPolicyAnalysisState", + "id": 2 + } + } + }, + "Edge": { + "fields": { + "sourceNode": { + "type": "string", + "id": 1 + }, + "targetNode": { + "type": "string", + "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 + }, + "conditionEvaluation": { + "type": "ConditionEvaluation", + "id": 4 + } + } + }, + "IdentityList": { + "fields": { + "identities": { + "rule": "repeated", + "type": "Identity", + "id": 1 + }, + "groupEdges": { + "rule": "repeated", + "type": "Edge", + "id": 2 + } + } + } + } + } + } + } + } + }, + "orgpolicy": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OrgPolicy.V1", + "go_package": "cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb", + "java_multiple_files": true, + "java_outer_classname": "OrgPolicyProto", + "java_package": "com.google.cloud.orgpolicy.v1", + "php_namespace": "Google\\Cloud\\OrgPolicy\\V1", + "ruby_package": "Google::Cloud::OrgPolicy::V1" + }, + "nested": { + "Policy": { + "oneofs": { + "policyType": { + "oneof": [ + "listPolicy", + "booleanPolicy", + "restoreDefault" + ] + } + }, + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "constraint": { + "type": "string", + "id": 2 + }, + "etag": { + "type": "bytes", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "listPolicy": { + "type": "ListPolicy", + "id": 5 + }, + "booleanPolicy": { + "type": "BooleanPolicy", + "id": 6 + }, + "restoreDefault": { + "type": "RestoreDefault", + "id": 7 + } + }, + "nested": { + "ListPolicy": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "deniedValues": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "allValues": { + "type": "AllValues", + "id": 3 + }, + "suggestedValue": { + "type": "string", + "id": 4 + }, + "inheritFromParent": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "AllValues": { + "values": { + "ALL_VALUES_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 + } + } + } + }, + "BooleanPolicy": { + "fields": { + "enforced": { + "type": "bool", + "id": 1 + } + } + }, + "RestoreDefault": { + "fields": {} + } + } + } + } + } + } + }, + "osconfig": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OsConfig.V1", + "go_package": "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb", + "java_multiple_files": true, + "java_outer_classname": "Inventories", + "java_package": "com.google.cloud.osconfig.v1", + "php_namespace": "Google\\Cloud\\OsConfig\\V1", + "ruby_package": "Google::Cloud::OsConfig::V1" + }, + "nested": { + "Inventory": { + "options": { + "(google.api.resource).type": "osconfig.googleapis.com/Inventory", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/inventory" + }, + "fields": { + "name": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "osInfo": { + "type": "OsInfo", + "id": 1 + }, + "items": { + "keyType": "string", + "type": "Item", + "id": 2 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "OsInfo": { + "fields": { + "hostname": { + "type": "string", + "id": 9 + }, + "longName": { + "type": "string", + "id": 2 + }, + "shortName": { + "type": "string", + "id": 3 + }, + "version": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 5 + }, + "kernelVersion": { + "type": "string", + "id": 6 + }, + "kernelRelease": { + "type": "string", + "id": 7 + }, + "osconfigAgentVersion": { + "type": "string", + "id": 8 + } + } + }, + "Item": { + "oneofs": { + "details": { + "oneof": [ + "installedPackage", + "availablePackage" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "originType": { + "type": "OriginType", + "id": 2 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9 + }, + "type": { + "type": "Type", + "id": 5 + }, + "installedPackage": { + "type": "SoftwarePackage", + "id": 6 + }, + "availablePackage": { + "type": "SoftwarePackage", + "id": 7 + } + }, + "nested": { + "OriginType": { + "values": { + "ORIGIN_TYPE_UNSPECIFIED": 0, + "INVENTORY_REPORT": 1 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "INSTALLED_PACKAGE": 1, + "AVAILABLE_PACKAGE": 2 + } + } + } + }, + "SoftwarePackage": { + "oneofs": { + "details": { + "oneof": [ + "yumPackage", + "aptPackage", + "zypperPackage", + "googetPackage", + "zypperPatch", + "wuaPackage", + "qfePackage", + "cosPackage", + "windowsApplication" + ] + } + }, + "fields": { + "yumPackage": { + "type": "VersionedPackage", + "id": 1 + }, + "aptPackage": { + "type": "VersionedPackage", + "id": 2 + }, + "zypperPackage": { + "type": "VersionedPackage", + "id": 3 + }, + "googetPackage": { + "type": "VersionedPackage", + "id": 4 + }, + "zypperPatch": { + "type": "ZypperPatch", + "id": 5 + }, + "wuaPackage": { + "type": "WindowsUpdatePackage", + "id": 6 + }, + "qfePackage": { + "type": "WindowsQuickFixEngineeringPackage", + "id": 7 + }, + "cosPackage": { + "type": "VersionedPackage", + "id": 8 + }, + "windowsApplication": { + "type": "WindowsApplication", + "id": 9 + } + } + }, + "VersionedPackage": { + "fields": { + "packageName": { + "type": "string", + "id": 4 + }, + "architecture": { + "type": "string", + "id": 2 + }, + "version": { + "type": "string", + "id": 3 + } + } + }, + "ZypperPatch": { + "fields": { + "patchName": { + "type": "string", + "id": 5 + }, + "category": { + "type": "string", + "id": 2 + }, + "severity": { + "type": "string", + "id": 3 + }, + "summary": { + "type": "string", + "id": 4 + } + } + }, + "WindowsUpdatePackage": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "categories": { + "rule": "repeated", + "type": "WindowsUpdateCategory", + "id": 3 + }, + "kbArticleIds": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "supportUrl": { + "type": "string", + "id": 11 + }, + "moreInfoUrls": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "updateId": { + "type": "string", + "id": 6 + }, + "revisionNumber": { + "type": "int32", + "id": 7 + }, + "lastDeploymentChangeTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + } + }, + "nested": { + "WindowsUpdateCategory": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + } + } + }, + "WindowsQuickFixEngineeringPackage": { + "fields": { + "caption": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "hotFixId": { + "type": "string", + "id": 3 + }, + "installTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + } + } + }, + "WindowsApplication": { + "fields": { + "displayName": { + "type": "string", + "id": 1 + }, + "displayVersion": { + "type": "string", + "id": 2 + }, + "publisher": { + "type": "string", + "id": 3 + }, + "installDate": { + "type": "google.type.Date", + "id": 4 + }, + "helpLink": { + "type": "string", + "id": 5 + } + } + } + } + }, + "GetInventoryRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "osconfig.googleapis.com/Inventory" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + } + } + }, + "ListInventoriesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Instance" + } + }, + "view": { + "type": "InventoryView", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListInventoriesResponse": { + "fields": { + "inventories": { + "rule": "repeated", + "type": "Inventory", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "InventoryView": { + "values": { + "INVENTORY_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "type": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Date": { + "fields": { + "year": { + "type": "int32", + "id": 1 + }, + "month": { + "type": "int32", + "id": 2 + }, + "day": { + "type": "int32", + "id": 3 + } + } + }, + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "identity": { + "nested": { + "accesscontextmanager": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.V1", + "go_package": "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb", + "java_multiple_files": true, + "java_outer_classname": "ServicePerimeterProto", + "java_package": "com.google.identity.accesscontextmanager.v1", + "objc_class_prefix": "GACM", + "php_namespace": "Google\\Identity\\AccessContextManager\\V1", + "ruby_package": "Google::Identity::AccessContextManager::V1" + }, + "nested": { + "AccessLevel": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/AccessLevel", + "(google.api.resource).pattern": "accessPolicies/{access_policy}/accessLevels/{access_level}" + }, + "oneofs": { + "level": { + "oneof": [ + "basic", + "custom" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "basic": { + "type": "BasicLevel", + "id": 4 + }, + "custom": { + "type": "CustomLevel", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "BasicLevel": { + "fields": { + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 1 + }, + "combiningFunction": { + "type": "ConditionCombiningFunction", + "id": 2 + } + }, + "nested": { + "ConditionCombiningFunction": { + "values": { + "AND": 0, + "OR": 1 + } + } + } + }, + "Condition": { + "fields": { + "ipSubnetworks": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "devicePolicy": { + "type": "DevicePolicy", + "id": 2 + }, + "requiredAccessLevels": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "negate": { + "type": "bool", + "id": 5 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "regions": { + "rule": "repeated", + "type": "string", + "id": 7 + } + } + }, + "CustomLevel": { + "fields": { + "expr": { + "type": "google.type.Expr", + "id": 1 + } + } + }, + "DevicePolicy": { + "fields": { + "requireScreenlock": { + "type": "bool", + "id": 1 + }, + "allowedEncryptionStatuses": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceEncryptionStatus", + "id": 2 + }, + "osConstraints": { + "rule": "repeated", + "type": "OsConstraint", + "id": 3 + }, + "allowedDeviceManagementLevels": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceManagementLevel", + "id": 6 + }, + "requireAdminApproval": { + "type": "bool", + "id": 7 + }, + "requireCorpOwned": { + "type": "bool", + "id": 8 + } + } + }, + "OsConstraint": { + "fields": { + "osType": { + "type": "google.identity.accesscontextmanager.type.OsType", + "id": 1 + }, + "minimumVersion": { + "type": "string", + "id": 2 + }, + "requireVerifiedChromeOs": { + "type": "bool", + "id": 3 + } + } + }, + "AccessPolicy": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/AccessPolicy", + "(google.api.resource).pattern": "accessPolicies/{access_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "title": { + "type": "string", + "id": 3 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + }, + "ServicePerimeter": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/ServicePerimeter", + "(google.api.resource).pattern": "accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "perimeterType": { + "type": "PerimeterType", + "id": 6 + }, + "status": { + "type": "ServicePerimeterConfig", + "id": 7 + }, + "spec": { + "type": "ServicePerimeterConfig", + "id": 8 + }, + "useExplicitDryRunSpec": { + "type": "bool", + "id": 9 + } + }, + "nested": { + "PerimeterType": { + "values": { + "PERIMETER_TYPE_REGULAR": 0, + "PERIMETER_TYPE_BRIDGE": 1 + } + } + } + }, + "ServicePerimeterConfig": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "accessLevels": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "restrictedServices": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "vpcAccessibleServices": { + "type": "VpcAccessibleServices", + "id": 10 + }, + "ingressPolicies": { + "rule": "repeated", + "type": "IngressPolicy", + "id": 8 + }, + "egressPolicies": { + "rule": "repeated", + "type": "EgressPolicy", + "id": 9 + } + }, + "nested": { + "VpcAccessibleServices": { + "fields": { + "enableRestriction": { + "type": "bool", + "id": 1 + }, + "allowedServices": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "IdentityType": { + "values": { + "IDENTITY_TYPE_UNSPECIFIED": 0, + "ANY_IDENTITY": 1, + "ANY_USER_ACCOUNT": 2, + "ANY_SERVICE_ACCOUNT": 3 + } + }, + "MethodSelector": { + "oneofs": { + "kind": { + "oneof": [ + "method", + "permission" + ] + } + }, + "fields": { + "method": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + } + } + }, + "ApiOperation": { + "fields": { + "serviceName": { + "type": "string", + "id": 1 + }, + "methodSelectors": { + "rule": "repeated", + "type": "MethodSelector", + "id": 2 + } + } + }, + "IngressSource": { + "oneofs": { + "source": { + "oneof": [ + "accessLevel", + "resource" + ] + } + }, + "fields": { + "accessLevel": { + "type": "string", + "id": 1 + }, + "resource": { + "type": "string", + "id": 2 + } + } + }, + "IngressFrom": { + "fields": { + "sources": { + "rule": "repeated", + "type": "IngressSource", + "id": 1 + }, + "identities": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "identityType": { + "type": "IdentityType", + "id": 3 + } + } + }, + "IngressTo": { + "fields": { + "operations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 1 + }, + "resources": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "IngressPolicy": { + "fields": { + "ingressFrom": { + "type": "IngressFrom", + "id": 1 + }, + "ingressTo": { + "type": "IngressTo", + "id": 2 + } + } + }, + "EgressFrom": { + "fields": { + "identities": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "identityType": { + "type": "IdentityType", + "id": 2 + } + } + }, + "EgressTo": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "operations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 2 + }, + "externalResources": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "EgressPolicy": { + "fields": { + "egressFrom": { + "type": "EgressFrom", + "id": 1 + }, + "egressTo": { + "type": "EgressTo", + "id": 2 + } + } + } + } + } + } + }, + "type": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.Type", + "go_package": "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type", + "java_package": "com.google.identity.accesscontextmanager.type", + "java_multiple_files": true, + "java_outer_classname": "TypeProto", + "php_namespace": "Google\\Identity\\AccessContextManager\\Type", + "ruby_package": "Google::Identity::AccessContextManager::Type" + }, + "nested": { + "DeviceEncryptionStatus": { + "values": { + "ENCRYPTION_UNSPECIFIED": 0, + "ENCRYPTION_UNSUPPORTED": 1, + "UNENCRYPTED": 2, + "ENCRYPTED": 3 + } + }, + "OsType": { + "values": { + "OS_UNSPECIFIED": 0, + "DESKTOP_MAC": 1, + "DESKTOP_WINDOWS": 2, + "DESKTOP_LINUX": 3, + "DESKTOP_CHROME_OS": 6, + "ANDROID": 4, + "IOS": 5 + } + }, + "DeviceManagementLevel": { + "values": { + "MANAGEMENT_UNSPECIFIED": 0, + "NONE": 1, + "BASIC": 2, + "COMPLETE": 3 + } + } + } + } + } + } + } + }, + "rpc": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC", + "cc_enable_arenas": true + }, + "nested": { + "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 + } + }, + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_iam_policy.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_iam_policy.js new file mode 100644 index 00000000000..0f9489bff46 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -0,0 +1,89 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(analysisQuery) { + // [START cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The request query. + */ + // const analysisQuery = {} + /** + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * MergeFrom (https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + */ + // const savedAnalysisQuery = 'abc123' + /** + * Optional. Amount of time executable has to complete. See JSON + * representation of + * Duration (https://developers.google.com/protocol-buffers/docs/proto3#json). + * If this field is set with a value less than the RPC deadline, and the + * execution of your query hasn't finished in the specified + * 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. + */ + // const executionTimeout = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callAnalyzeIamPolicy() { + // Construct request + const request = { + analysisQuery, + }; + + // Run request + const response = await assetClient.analyzeIamPolicy(request); + console.log(response); + } + + callAnalyzeIamPolicy(); + // [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js new file mode 100644 index 00000000000..805eb75f3d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -0,0 +1,84 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(analysisQuery, outputConfig) { + // [START cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The request query. + */ + // const analysisQuery = {} + /** + * Optional. The name of a saved query, which must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * MergeFrom (https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + */ + // const savedAnalysisQuery = 'abc123' + /** + * Required. Output configuration indicating where the results will be output + * to. + */ + // const outputConfig = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callAnalyzeIamPolicyLongrunning() { + // Construct request + const request = { + analysisQuery, + outputConfig, + }; + + // Run request + const [operation] = await assetClient.analyzeIamPolicyLongrunning(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAnalyzeIamPolicyLongrunning(); + // [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_move.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_move.js new file mode 100644 index 00000000000..640204b704e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_move.js @@ -0,0 +1,78 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, destinationParent) { + // [START cloudasset_v1_generated_AssetService_AnalyzeMove_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource to perform the analysis against. + * Only Google Cloud projects are supported as of today. Hence, this can only + * be a project ID (such as "projects/my-project-id") or a project number + * (such as "projects/12345"). + */ + // const resource = 'abc123' + /** + * Required. Name of the Google Cloud folder or organization to reparent the + * target resource. The analysis will be performed against hypothetically + * moving the resource to this specified desitination parent. This can only be + * a folder number (such as "folders/123") or an organization number (such as + * "organizations/123"). + */ + // const destinationParent = 'abc123' + /** + * Analysis view indicating what information should be included in the + * analysis response. If unspecified, the default view is FULL. + */ + // const view = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callAnalyzeMove() { + // Construct request + const request = { + resource, + destinationParent, + }; + + // Run request + const response = await assetClient.analyzeMove(request); + console.log(response); + } + + callAnalyzeMove(); + // [END cloudasset_v1_generated_AssetService_AnalyzeMove_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policies.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policies.js new file mode 100644 index 00000000000..a6bc51afa62 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policies.js @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope, constraint) { + // [START cloudasset_v1_generated_AssetService_AnalyzeOrgPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + */ + // const scope = 'abc123' + /** + * Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + */ + // const constraint = 'abc123' + /** + * The expression to filter + * AnalyzeOrgPoliciesResponse.org_policy_results google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + */ + // const filter = 'abc123' + /** + * The maximum number of items to return per page. If unspecified, + * AnalyzeOrgPoliciesResponse.org_policy_results google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results + * will contain 20 items with a maximum of 200. + */ + // const pageSize = 1234 + /** + * The pagination token to retrieve the next page. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callAnalyzeOrgPolicies() { + // Construct request + const request = { + scope, + constraint, + }; + + // Run request + const iterable = assetClient.analyzeOrgPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callAnalyzeOrgPolicies(); + // [END cloudasset_v1_generated_AssetService_AnalyzeOrgPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policy_governed_assets.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policy_governed_assets.js new file mode 100644 index 00000000000..11c10297d3d --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policy_governed_assets.js @@ -0,0 +1,112 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope, constraint) { + // [START cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + */ + // const scope = 'abc123' + /** + * Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + */ + // const constraint = 'abc123' + /** + * The expression to filter + * AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets. + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + */ + // const filter = 'abc123' + /** + * The maximum number of items to return per page. If unspecified, + * AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets + * will contain 100 items with a maximum of 200. + */ + // const pageSize = 1234 + /** + * The pagination token to retrieve the next page. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callAnalyzeOrgPolicyGovernedAssets() { + // Construct request + const request = { + scope, + constraint, + }; + + // Run request + const iterable = assetClient.analyzeOrgPolicyGovernedAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callAnalyzeOrgPolicyGovernedAssets(); + // [END cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policy_governed_containers.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policy_governed_containers.js new file mode 100644 index 00000000000..bdb362d0943 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.analyze_org_policy_governed_containers.js @@ -0,0 +1,97 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope, constraint) { + // [START cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedContainers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + */ + // const scope = 'abc123' + /** + * Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + */ + // const constraint = 'abc123' + /** + * The expression to filter + * AnalyzeOrgPolicyGovernedContainersResponse.governed_containers google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + */ + // const filter = 'abc123' + /** + * The maximum number of items to return per page. If unspecified, + * AnalyzeOrgPolicyGovernedContainersResponse.governed_containers google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers + * will contain 100 items with a maximum of 200. + */ + // const pageSize = 1234 + /** + * The pagination token to retrieve the next page. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callAnalyzeOrgPolicyGovernedContainers() { + // Construct request + const request = { + scope, + constraint, + }; + + // Run request + const iterable = assetClient.analyzeOrgPolicyGovernedContainersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callAnalyzeOrgPolicyGovernedContainers(); + // [END cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedContainers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.batch_get_assets_history.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.batch_get_assets_history.js new file mode 100644 index 00000000000..057c26548f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.batch_get_assets_history.js @@ -0,0 +1,104 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + */ + // const parent = 'abc123' + /** + * A list of the full names of the assets. + * See: https://cloud.google.com/asset-inventory/docs/resource-name-format + * Example: + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + */ + // const assetNames = ['abc','def'] + /** + * Optional. The content type. + */ + // const contentType = {} + /** + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after the current time minus + * 35 days. If end_time is not set, it is default to current timestamp. + * If start_time is not set, the snapshot of the assets at end_time will be + * returned. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + */ + // const readTimeWindow = {} + /** + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the asset_names. It + * returns an error if any of the relationship_types doesn't belong to the + * supported relationship types of the asset_names or if any of the + * asset_names's types doesn't belong to the source types of the + * relationship_types. + * * Otherwise: + * it outputs the supported relationships' history on the asset_names or + * returns an error if any of the asset_names's types has no relationship + * support. + * See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + */ + // const relationshipTypes = ['abc','def'] + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callBatchGetAssetsHistory() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await assetClient.batchGetAssetsHistory(request); + console.log(response); + } + + callBatchGetAssetsHistory(); + // [END cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js new file mode 100644 index 00000000000..cdb2384b863 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js @@ -0,0 +1,77 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope, names) { + // [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Only IAM policies on or below the scope will be returned. + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * To know how to get organization ID, visit here + * (https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * To know how to get folder or project ID, visit here + * (https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + */ + // const scope = 'abc123' + /** + * Required. The names refer to the full_resource_names + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the asset types supported by search + * APIs (https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + */ + // const names = ['abc','def'] + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callBatchGetEffectiveIamPolicies() { + // Construct request + const request = { + scope, + names, + }; + + // Run request + const response = await assetClient.batchGetEffectiveIamPolicies(request); + console.log(response); + } + + callBatchGetEffectiveIamPolicies(); + // [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.create_feed.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.create_feed.js new file mode 100644 index 00000000000..e94efd6dae3 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.create_feed.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, feedId, feed) { + // [START cloudasset_v1_generated_AssetService_CreateFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + */ + // const parent = 'abc123' + /** + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + */ + // const feedId = 'abc123' + /** + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const feed = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callCreateFeed() { + // Construct request + const request = { + parent, + feedId, + feed, + }; + + // Run request + const response = await assetClient.createFeed(request); + console.log(response); + } + + callCreateFeed(); + // [END cloudasset_v1_generated_AssetService_CreateFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.create_saved_query.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.create_saved_query.js new file mode 100644 index 00000000000..d22cdc89d07 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.create_saved_query.js @@ -0,0 +1,82 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, savedQuery, savedQueryId) { + // [START cloudasset_v1_generated_AssetService_CreateSavedQuery_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + */ + // const parent = 'abc123' + /** + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + */ + // const savedQuery = {} + /** + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * This value should be 4-63 characters, and valid characters + * are `[a-z][0-9]-`. + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + */ + // const savedQueryId = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callCreateSavedQuery() { + // Construct request + const request = { + parent, + savedQuery, + savedQueryId, + }; + + // Run request + const response = await assetClient.createSavedQuery(request); + console.log(response); + } + + callCreateSavedQuery(); + // [END cloudasset_v1_generated_AssetService_CreateSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.delete_feed.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.delete_feed.js new file mode 100644 index 00000000000..8d58b4ec3aa --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.delete_feed.js @@ -0,0 +1,64 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudasset_v1_generated_AssetService_DeleteFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callDeleteFeed() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.deleteFeed(request); + console.log(response); + } + + callDeleteFeed(); + // [END cloudasset_v1_generated_AssetService_DeleteFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.delete_saved_query.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.delete_saved_query.js new file mode 100644 index 00000000000..d5895d97f85 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.delete_saved_query.js @@ -0,0 +1,65 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the saved query to delete. It must be in the format + * of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callDeleteSavedQuery() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.deleteSavedQuery(request); + console.log(response); + } + + callDeleteSavedQuery(); + // [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.export_assets.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.export_assets.js new file mode 100644 index 00000000000..6918b9ab05a --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.export_assets.js @@ -0,0 +1,119 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, outputConfig) { + // [START cloudasset_v1_generated_AssetService_ExportAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + */ + // const parent = 'abc123' + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + */ + // const readTime = {} + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + */ + // const assetTypes = ['abc','def'] + /** + * Asset content type. If not specified, no content but the asset name will be + * returned. + */ + // const contentType = {} + /** + * Required. Output configuration indicating where the results will be output + * to. + */ + // const outputConfig = {} + /** + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the relationship_types doesn't belong to the supported + * relationship types of the asset_types or if any of the asset_types + * doesn't belong to the source types of the relationship_types. + * * Otherwise: + * it snapshots the supported relationships for all asset_types or returns + * an error if any of the asset_types has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + */ + // const relationshipTypes = ['abc','def'] + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callExportAssets() { + // Construct request + const request = { + parent, + outputConfig, + }; + + // Run request + const [operation] = await assetClient.exportAssets(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportAssets(); + // [END cloudasset_v1_generated_AssetService_ExportAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.get_feed.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.get_feed.js new file mode 100644 index 00000000000..26e583bb1dc --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.get_feed.js @@ -0,0 +1,64 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudasset_v1_generated_AssetService_GetFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callGetFeed() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.getFeed(request); + console.log(response); + } + + callGetFeed(); + // [END cloudasset_v1_generated_AssetService_GetFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.get_saved_query.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.get_saved_query.js new file mode 100644 index 00000000000..c8d20097cc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.get_saved_query.js @@ -0,0 +1,64 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudasset_v1_generated_AssetService_GetSavedQuery_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the saved query and it must be in the format of: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callGetSavedQuery() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.getSavedQuery(request); + console.log(response); + } + + callGetSavedQuery(); + // [END cloudasset_v1_generated_AssetService_GetSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_assets.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_assets.js new file mode 100644 index 00000000000..dd2a476889a --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_assets.js @@ -0,0 +1,126 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudasset_v1_generated_AssetService_ListAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + */ + // const parent = 'abc123' + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + */ + // const readTime = {} + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expression is also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + */ + // const assetTypes = ['abc','def'] + /** + * Asset content type. If not specified, no content but the asset name will + * be returned. + */ + // const contentType = {} + /** + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + */ + // const pageSize = 1234 + /** + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + */ + // const pageToken = 'abc123' + /** + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the relationship_types doesn't belong to the supported + * relationship types of the asset_types or if any of the asset_types + * doesn't belong to the source types of the relationship_types. + * * Otherwise: + * it snapshots the supported relationships for all asset_types or returns + * an error if any of the asset_types has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + */ + // const relationshipTypes = ['abc','def'] + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = assetClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [END cloudasset_v1_generated_AssetService_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_feeds.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_feeds.js new file mode 100644 index 00000000000..f92ee4f4a7e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_feeds.js @@ -0,0 +1,63 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudasset_v1_generated_AssetService_ListFeeds_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + */ + // const parent = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callListFeeds() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await assetClient.listFeeds(request); + console.log(response); + } + + callListFeeds(); + // [END cloudasset_v1_generated_AssetService_ListFeeds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_saved_queries.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_saved_queries.js new file mode 100644 index 00000000000..93a1e689491 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.list_saved_queries.js @@ -0,0 +1,88 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudasset_v1_generated_AssetService_ListSavedQueries_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + */ + // const parent = 'abc123' + /** + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * See https://google.aip.dev/160 for more information on the grammar. + */ + // const filter = 'abc123' + /** + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callListSavedQueries() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = assetClient.listSavedQueriesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSavedQueries(); + // [END cloudasset_v1_generated_AssetService_ListSavedQueries_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.query_assets.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.query_assets.js new file mode 100644 index 00000000000..ddd146016ac --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.query_assets.js @@ -0,0 +1,123 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudasset_v1_generated_AssetService_QueryAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * Only assets belonging to the `parent` will be returned. + */ + // const parent = 'abc123' + /** + * Optional. A SQL statement that's compatible with BigQuery + * SQL (https://cloud.google.com/bigquery/docs/introduction-sql). + */ + // const statement = 'abc123' + /** + * Optional. Reference to the query job, which is from the + * `QueryAssetsResponse` of previous `QueryAssets` call. + */ + // const jobReference = 'abc123' + /** + * Optional. The maximum number of rows to return in the results. Responses + * are limited to 10 MB and 1000 rows. + * By default, the maximum row count is 1000. When the byte or row count limit + * is reached, the rest of the query results will be paginated. + * The field will be ignored when output_config is specified. + */ + // const pageSize = 1234 + /** + * Optional. A page token received from previous `QueryAssets`. + * The field will be ignored when output_config is specified. + */ + // const pageToken = 'abc123' + /** + * Optional. Specifies the maximum amount of time that the client is willing + * to wait for the query to complete. By default, this limit is 5 min for the + * first query, and 1 minute for the following queries. If the query is + * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + * false. + * Like BigQuery jobs.query + * API (https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + * The call is not guaranteed to wait for the specified timeout; it typically + * returns after around 200 seconds (200,000 milliseconds), even if the query + * is not complete. + * The field will be ignored when output_config is specified. + */ + // const timeout = {} + /** + * Optional. start_time is required. start_time must be less than + * end_time Defaults end_time to now if start_time is set and + * end_time isn't. Maximum permitted time range is 7 days. + */ + // const readTimeWindow = {} + /** + * Optional. Queries cloud assets as they appeared at the specified point in + * time. + */ + // const readTime = {} + /** + * Optional. Destination where the query results will be saved. + * When this field is specified, the query results won't be saved in the + * QueryAssetsResponse.query_result. Instead + * QueryAssetsResponse.output_config will be set. + * Meanwhile, QueryAssetsResponse.job_reference will be set and can be used + * to check the status of the query job when passed to a following + * QueryAssets API call. + */ + // const outputConfig = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callQueryAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await assetClient.queryAssets(request); + console.log(response); + } + + callQueryAssets(); + // [END cloudasset_v1_generated_AssetService_QueryAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.search_all_iam_policies.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.search_all_iam_policies.js new file mode 100644 index 00000000000..9f3b9e9b2db --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -0,0 +1,160 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope) { + // [START cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * `cloudasset.assets.searchAllIamPolicies` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + */ + // const scope = 'abc123' + /** + * Optional. The query statement. See how to construct a + * query (https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the IAM policy + * documentation (https://cloud.google.com/iam/help/allow-policies/structure). + * Examples: + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + */ + // const query = 'abc123' + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + */ + // const pageSize = 1234 + /** + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + */ + // const pageToken = 'abc123' + /** + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the asset + * types supported by search + * APIs (https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + */ + // const assetTypes = ['abc','def'] + /** + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + */ + // const orderBy = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callSearchAllIamPolicies() { + // Construct request + const request = { + scope, + }; + + // Run request + const iterable = assetClient.searchAllIamPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchAllIamPolicies(); + // [END cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.search_all_resources.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.search_all_resources.js new file mode 100644 index 00000000000..bfe6ed5741e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.search_all_resources.js @@ -0,0 +1,233 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope) { + // [START cloudasset_v1_generated_AssetService_SearchAllResources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * `cloudasset.assets.searchAllResources` (https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * The allowed values are: + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + */ + // const scope = 'abc123' + /** + * Optional. The query statement. See how to construct a + * query (https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * Examples: + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * `TagKey.namespacedName` (https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * `TagValue.namespacedName` (https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * `TagValue.name` (https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * `TagKey.namespacedName` (https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * `TagValue.namespacedName` (https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * `TagValue.name` (https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + */ + // const query = 'abc123' + /** + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types supported by search + * APIs (https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + */ + // const assetTypes = ['abc','def'] + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + */ + // const pageSize = 1234 + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + */ + // const pageToken = 'abc123' + /** + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only the following fields in the response are sortable: + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + */ + // const orderBy = 'abc123' + /** + * Optional. A comma-separated list of fields that you want returned in the + * results. The following fields are returned by default if not specified: + * * `name` + * * `assetType` + * * `project` + * * `folders` + * * `organization` + * * `displayName` + * * `description` + * * `location` + * * `labels` + * * `tags` + * * `effectiveTags` + * * `networkTags` + * * `kmsKeys` + * * `createTime` + * * `updateTime` + * * `state` + * * `additionalAttributes` + * * `parentFullResourceName` + * * `parentAssetType` + * Some fields of large size, such as `versionedResources`, + * `attachedResources`, `effectiveTags` etc., are not returned by default, but + * you can specify them in the `read_mask` parameter if you want to include + * them. If `"*"` is specified, all available + * fields (https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + * are returned. + * Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + * Any invalid field path will trigger INVALID_ARGUMENT error. + */ + // const readMask = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callSearchAllResources() { + // Construct request + const request = { + scope, + }; + + // Run request + const iterable = assetClient.searchAllResourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchAllResources(); + // [END cloudasset_v1_generated_AssetService_SearchAllResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.update_feed.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.update_feed.js new file mode 100644 index 00000000000..b73a7e9794f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.update_feed.js @@ -0,0 +1,72 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(feed, updateMask) { + // [START cloudasset_v1_generated_AssetService_UpdateFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + */ + // const feed = {} + /** + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + */ + // const updateMask = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callUpdateFeed() { + // Construct request + const request = { + feed, + updateMask, + }; + + // Run request + const response = await assetClient.updateFeed(request); + console.log(response); + } + + callUpdateFeed(); + // [END cloudasset_v1_generated_AssetService_UpdateFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.update_saved_query.js b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.update_saved_query.js new file mode 100644 index 00000000000..09f4bc2bf14 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/asset_service.update_saved_query.js @@ -0,0 +1,71 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(savedQuery, updateMask) { + // [START cloudasset_v1_generated_AssetService_UpdateSavedQuery_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The saved query to update. + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + */ + // const savedQuery = {} + /** + * Required. The list of fields to update. + */ + // const updateMask = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callUpdateSavedQuery() { + // Construct request + const request = { + savedQuery, + updateMask, + }; + + // Run request + const response = await assetClient.updateSavedQuery(request); + console.log(response); + } + + callUpdateSavedQuery(); + // [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/snippet_metadata_google.cloud.asset.v1.json b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/snippet_metadata_google.cloud.asset.v1.json new file mode 100644 index 00000000000..697097fac88 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/samples/generated/v1/snippet_metadata_google.cloud.asset.v1.json @@ -0,0 +1,1183 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1_generated_AssetService_ExportAssets_async", + "title": "AssetService exportAssets Sample", + "origin": "API_DEFINITION", + "description": " Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1.Asset][google.cloud.asset.v1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset Protobuf as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API, which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.", + "canonical": true, + "file": "asset_service.export_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 111, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportAssets", + "fullName": "google.cloud.asset.v1.AssetService.ExportAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1.OutputConfig" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ExportAssets", + "fullName": "google.cloud.asset.v1.AssetService.ExportAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_ListAssets_async", + "title": "AssetService listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists assets with time and resource types and returns paged results in response.", + "canonical": true, + "file": "asset_service.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 118, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1.AssetService.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.ListAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1.AssetService.ListAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async", + "title": "AssetService batchGetAssetsHistory Sample", + "origin": "API_DEFINITION", + "description": " Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.", + "canonical": true, + "file": "asset_service.batch_get_assets_history.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchGetAssetsHistory", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetAssetsHistory", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "asset_names", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1.ContentType" + }, + { + "name": "read_time_window", + "type": ".google.cloud.asset.v1.TimeWindow" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.BatchGetAssetsHistoryResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "BatchGetAssetsHistory", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetAssetsHistory", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_CreateFeed_async", + "title": "AssetService createFeed Sample", + "origin": "API_DEFINITION", + "description": " Creates a feed in a parent project/folder/organization to listen to its asset updates.", + "canonical": true, + "file": "asset_service.create_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1.AssetService.CreateFeed", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "feed_id", + "type": "TYPE_STRING" + }, + { + "name": "feed", + "type": ".google.cloud.asset.v1.Feed" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1.AssetService.CreateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_GetFeed_async", + "title": "AssetService getFeed Sample", + "origin": "API_DEFINITION", + "description": " Gets details about an asset feed.", + "canonical": true, + "file": "asset_service.get_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1.AssetService.GetFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1.AssetService.GetFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_ListFeeds_async", + "title": "AssetService listFeeds Sample", + "origin": "API_DEFINITION", + "description": " Lists all asset feeds in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_feeds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1.AssetService.ListFeeds", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.ListFeedsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1.AssetService.ListFeeds", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_UpdateFeed_async", + "title": "AssetService updateFeed Sample", + "origin": "API_DEFINITION", + "description": " Updates an asset feed configuration.", + "canonical": true, + "file": "asset_service.update_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1.AssetService.UpdateFeed", + "async": true, + "parameters": [ + { + "name": "feed", + "type": ".google.cloud.asset.v1.Feed" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1.AssetService.UpdateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_DeleteFeed_async", + "title": "AssetService deleteFeed Sample", + "origin": "API_DEFINITION", + "description": " Deletes an asset feed.", + "canonical": true, + "file": "asset_service.delete_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1.AssetService.DeleteFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1.AssetService.DeleteFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_SearchAllResources_async", + "title": "AssetService searchAllResources Sample", + "origin": "API_DEFINITION", + "description": " Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllResources` permission on the desired scope, otherwise the request will be rejected.", + "canonical": true, + "file": "asset_service.search_all_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 225, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllResources", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "read_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.SearchAllResourcesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllResources", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async", + "title": "AssetService searchAllIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Searches all IAM policies within the specified scope, such as a project, folder, or organization. The caller must be granted the `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, otherwise the request will be rejected.", + "canonical": true, + "file": "asset_service.search_all_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 152, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SearchAllIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.SearchAllIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async", + "title": "AssetService analyzeIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Analyzes IAM policies to answer which identities have what accesses on which resources.", + "canonical": true, + "file": "asset_service.analyze_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicy", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" + }, + { + "name": "saved_analysis_query", + "type": "TYPE_STRING" + }, + { + "name": "execution_timeout", + "type": ".google.protobuf.Duration" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeIamPolicyResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeIamPolicy", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicy", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async", + "title": "AssetService analyzeIamPolicyLongrunning Sample", + "origin": "API_DEFINITION", + "description": " Analyzes IAM policies asynchronously to answer which identities have what accesses on which resources, and writes the analysis results to a Google Cloud Storage or a BigQuery destination. For Cloud Storage destination, the output format is the JSON format that represents a [AnalyzeIamPolicyResponse][google.cloud.asset.v1.AnalyzeIamPolicyResponse]. This method implements the [google.longrunning.Operation][google.longrunning.Operation], which allows you to track the operation status. We recommend intervals of at least 2 seconds with exponential backoff retry to poll the operation result. The metadata contains the metadata for the long-running operation.", + "canonical": true, + "file": "asset_service.analyze_iam_policy_longrunning.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeIamPolicyLongrunning", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning", + "async": true, + "parameters": [ + { + "name": "analysis_query", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisQuery" + }, + { + "name": "saved_analysis_query", + "type": "TYPE_STRING" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1.IamPolicyAnalysisOutputConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeIamPolicyLongrunning", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeIamPolicyLongrunning", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeMove_async", + "title": "AssetService analyzeMove Sample", + "origin": "API_DEFINITION", + "description": " Analyze moving a resource to a specified destination without kicking off the actual move. The analysis is best effort depending on the user's permissions of viewing different hierarchical policies and configurations. The policies and configuration are subject to change before the actual resource migration takes place.", + "canonical": true, + "file": "asset_service.analyze_move.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeMove", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeMove", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + }, + { + "name": "destination_parent", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeMoveResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeMove", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeMove", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_QueryAssets_async", + "title": "AssetService queryAssets Sample", + "origin": "API_DEFINITION", + "description": " Issue a job that queries assets using a SQL statement compatible with [BigQuery SQL](https://cloud.google.com/bigquery/docs/introduction-sql). If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the `QueryAssetsResponse`. Otherwise, full query results can be obtained by issuing extra requests with the `job_reference` from the a previous `QueryAssets` call. Note, the query result has approximately 10 GB limitation enforced by [BigQuery](https://cloud.google.com/bigquery/docs/best-practices-performance-output). Queries return larger results will result in errors.", + "canonical": true, + "file": "asset_service.query_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 115, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryAssets", + "fullName": "google.cloud.asset.v1.AssetService.QueryAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "statement", + "type": "TYPE_STRING" + }, + { + "name": "job_reference", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "timeout", + "type": ".google.protobuf.Duration" + }, + { + "name": "read_time_window", + "type": ".google.cloud.asset.v1.TimeWindow" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1.QueryAssetsOutputConfig" + } + ], + "resultType": ".google.cloud.asset.v1.QueryAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "QueryAssets", + "fullName": "google.cloud.asset.v1.AssetService.QueryAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_CreateSavedQuery_async", + "title": "AssetService createSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Creates a saved query in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.create_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.CreateSavedQuery", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "saved_query", + "type": ".google.cloud.asset.v1.SavedQuery" + }, + { + "name": "saved_query_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "CreateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.CreateSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_GetSavedQuery_async", + "title": "AssetService getSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Gets details about a saved query.", + "canonical": true, + "file": "asset_service.get_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.GetSavedQuery", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "GetSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.GetSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_ListSavedQueries_async", + "title": "AssetService listSavedQueries Sample", + "origin": "API_DEFINITION", + "description": " Lists all saved queries in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_saved_queries.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSavedQueries", + "fullName": "google.cloud.asset.v1.AssetService.ListSavedQueries", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.ListSavedQueriesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "ListSavedQueries", + "fullName": "google.cloud.asset.v1.AssetService.ListSavedQueries", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_UpdateSavedQuery_async", + "title": "AssetService updateSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Updates a saved query.", + "canonical": true, + "file": "asset_service.update_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.UpdateSavedQuery", + "async": true, + "parameters": [ + { + "name": "saved_query", + "type": ".google.cloud.asset.v1.SavedQuery" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1.SavedQuery", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.UpdateSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_DeleteSavedQuery_async", + "title": "AssetService deleteSavedQuery Sample", + "origin": "API_DEFINITION", + "description": " Deletes a saved query.", + "canonical": true, + "file": "asset_service.delete_saved_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.DeleteSavedQuery", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteSavedQuery", + "fullName": "google.cloud.asset.v1.AssetService.DeleteSavedQuery", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async", + "title": "AssetService batchGetEffectiveIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Gets effective IAM policies for a batch of resources.", + "canonical": true, + "file": "asset_service.batch_get_effective_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchGetEffectiveIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "names", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "BatchGetEffectiveIamPolicies", + "fullName": "google.cloud.asset.v1.AssetService.BatchGetEffectiveIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeOrgPolicies_async", + "title": "AssetService analyzeOrgPolicies Sample", + "origin": "API_DEFINITION", + "description": " Analyzes organization policies under a scope.", + "canonical": true, + "file": "asset_service.analyze_org_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeOrgPolicies", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeOrgPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "constraint", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeOrgPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeOrgPolicies", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeOrgPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedContainers_async", + "title": "AssetService analyzeOrgPolicyGovernedContainers Sample", + "origin": "API_DEFINITION", + "description": " Analyzes organization policies governed containers (projects, folders or organization) under a scope.", + "canonical": true, + "file": "asset_service.analyze_org_policy_governed_containers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeOrgPolicyGovernedContainers", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedContainers", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "constraint", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeOrgPolicyGovernedContainers", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedContainers", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedAssets_async", + "title": "AssetService analyzeOrgPolicyGovernedAssets Sample", + "origin": "API_DEFINITION", + "description": " Analyzes organization policies governed assets (Google Cloud resources or policies) under a scope. This RPC supports custom constraints and the following canned constraints: * constraints/ainotebooks.accessMode * constraints/ainotebooks.disableFileDownloads * constraints/ainotebooks.disableRootAccess * constraints/ainotebooks.disableTerminal * constraints/ainotebooks.environmentOptions * constraints/ainotebooks.requireAutoUpgradeSchedule * constraints/ainotebooks.restrictVpcNetworks * constraints/compute.disableGuestAttributesAccess * constraints/compute.disableInstanceDataAccessApis * constraints/compute.disableNestedVirtualization * constraints/compute.disableSerialPortAccess * constraints/compute.disableSerialPortLogging * constraints/compute.disableVpcExternalIpv6 * constraints/compute.requireOsLogin * constraints/compute.requireShieldedVm * constraints/compute.restrictLoadBalancerCreationForTypes * constraints/compute.restrictProtocolForwardingCreationForTypes * constraints/compute.restrictXpnProjectLienRemoval * constraints/compute.setNewProjectDefaultToZonalDNSOnly * constraints/compute.skipDefaultNetworkCreation * constraints/compute.trustedImageProjects * constraints/compute.vmCanIpForward * constraints/compute.vmExternalIpAccess * constraints/gcp.detailedAuditLoggingMode * constraints/gcp.resourceLocations * constraints/iam.allowedPolicyMemberDomains * constraints/iam.automaticIamGrantsForDefaultServiceAccounts * constraints/iam.disableServiceAccountCreation * constraints/iam.disableServiceAccountKeyCreation * constraints/iam.disableServiceAccountKeyUpload * constraints/iam.restrictCrossProjectServiceAccountLienRemoval * constraints/iam.serviceAccountKeyExpiryHours * constraints/resourcemanager.accessBoundaries * constraints/resourcemanager.allowedExportDestinations * constraints/sql.restrictAuthorizedNetworks * constraints/sql.restrictNoncompliantDiagnosticDataAccess * constraints/sql.restrictNoncompliantResourceCreation * constraints/sql.restrictPublicIp * constraints/storage.publicAccessPrevention * constraints/storage.restrictAuthTypes * constraints/storage.uniformBucketLevelAccess This RPC only returns either resources of types [supported by search APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) or IAM policies.", + "canonical": true, + "file": "asset_service.analyze_org_policy_governed_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 104, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AnalyzeOrgPolicyGovernedAssets", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedAssets", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "constraint", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1.AssetServiceClient" + }, + "method": { + "shortName": "AnalyzeOrgPolicyGovernedAssets", + "fullName": "google.cloud.asset.v1.AssetService.AnalyzeOrgPolicyGovernedAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1.AssetService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1/src/index.ts b/owl-bot-staging/google-cloud-asset/v1/src/index.ts new file mode 100644 index 00000000000..37657efa730 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const AssetServiceClient = v1.AssetServiceClient; +type AssetServiceClient = v1.AssetServiceClient; +export {v1, AssetServiceClient}; +export default {v1, AssetServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_client.ts b/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_client.ts new file mode 100644 index 00000000000..183137434c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_client.ts @@ -0,0 +1,4934 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './asset_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1 + */ +export class AssetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + assetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AssetServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AssetServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'cloudasset.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && '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}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + accessLevelPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/accessLevels/{access_level}' + ), + accessPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}' + ), + folderFeedPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/feeds/{feed}' + ), + folderSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/savedQueries/{saved_query}' + ), + inventoryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/inventory' + ), + organizationFeedPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/feeds/{feed}' + ), + organizationSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/savedQueries/{saved_query}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectFeedPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), + projectSavedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/savedQueries/{saved_query}' + ), + servicePerimeterPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAssets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'assets'), + searchAllResources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'results'), + searchAllIamPolicies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'results'), + listSavedQueries: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'savedQueries'), + analyzeOrgPolicies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'orgPolicyResults'), + analyzeOrgPolicyGovernedContainers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'governedContainers'), + analyzeOrgPolicyGovernedAssets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'governedAssets') + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // 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 lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=*/*/operations/*/**}',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const exportAssetsResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1.ExportAssetsResponse') as gax.protobuf.Type; + const exportAssetsMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1.ExportAssetsRequest') as gax.protobuf.Type; + const analyzeIamPolicyLongrunningResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningResponse') as gax.protobuf.Type; + const analyzeIamPolicyLongrunningMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportAssets: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportAssetsResponse.decode.bind(exportAssetsResponse), + exportAssetsMetadata.decode.bind(exportAssetsMetadata)), + analyzeIamPolicyLongrunning: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + analyzeIamPolicyLongrunningResponse.decode.bind(analyzeIamPolicyLongrunningResponse), + analyzeIamPolicyLongrunningMetadata.decode.bind(analyzeIamPolicyLongrunningMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.asset.v1.AssetService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.v1.AssetService. + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.asset.v1.AssetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.asset.v1.AssetService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const assetServiceStubMethods = + ['exportAssets', 'listAssets', 'batchGetAssetsHistory', 'createFeed', 'getFeed', 'listFeeds', 'updateFeed', 'deleteFeed', 'searchAllResources', 'searchAllIamPolicies', 'analyzeIamPolicy', 'analyzeIamPolicyLongrunning', 'analyzeMove', 'queryAssets', 'createSavedQuery', 'getSavedQuery', 'listSavedQueries', 'updateSavedQuery', 'deleteSavedQuery', 'batchGetEffectiveIamPolicies', 'analyzeOrgPolicies', 'analyzeOrgPolicyGovernedContainers', 'analyzeOrgPolicyGovernedAssets']; + for (const methodName of assetServiceStubMethods) { + const callPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.assetServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Batch gets the update history of assets that overlap a time window. + * For IAM_POLICY content, this API outputs history when the asset and its + * attached IAM POLICY both exist. This can create gaps in the output history. + * Otherwise, this API outputs history with asset in both non-delete or + * deleted status. + * If a specified asset does not exist, this API returns an INVALID_ARGUMENT + * error. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id")", or a project number (such as "projects/12345"). + * @param {string[]} request.assetNames + * A list of the full names of the assets. + * See: https://cloud.google.com/asset-inventory/docs/resource-name-format + * Example: + * + * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + * + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + * @param {google.cloud.asset.v1.ContentType} [request.contentType] + * Optional. The content type. + * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] + * Optional. The time window for the asset history. Both start_time and + * end_time are optional and if set, it must be after the current time minus + * 35 days. If end_time is not set, it is default to current timestamp. + * If start_time is not set, the snapshot of the assets at end_time will be + * returned. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + * @param {string[]} [request.relationshipTypes] + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the [asset_names]. It + * returns an error if any of the [relationship_types] doesn't belong to the + * supported relationship types of the [asset_names] or if any of the + * [asset_names]'s types doesn't belong to the source types of the + * [relationship_types]. + * * Otherwise: + * it outputs the supported relationships' history on the [asset_names] or + * returns an error if any of the [asset_names]'s types has no relationship + * support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * @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 {@link protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse|BatchGetAssetsHistoryResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.batch_get_assets_history.js + * region_tag:cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_async + */ + batchGetAssetsHistory( + request?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest|undefined, {}|undefined + ]>; + batchGetAssetsHistory( + request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest|null|undefined, + {}|null|undefined>): void; + batchGetAssetsHistory( + request: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + callback: Callback< + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest|null|undefined, + {}|null|undefined>): void; + batchGetAssetsHistory( + request?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchGetAssetsHistory(request, options, callback); + } +/** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * @param {string} request.feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @param {google.cloud.asset.v1.Feed} request.feed + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.Feed|Feed}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.create_feed.js + * region_tag:cloudasset_v1_generated_AssetService_CreateFeed_async + */ + createFeed( + request?: protos.google.cloud.asset.v1.ICreateFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest|undefined, {}|undefined + ]>; + createFeed( + request: protos.google.cloud.asset.v1.ICreateFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest|null|undefined, + {}|null|undefined>): void; + createFeed( + request: protos.google.cloud.asset.v1.ICreateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest|null|undefined, + {}|null|undefined>): void; + createFeed( + request?: protos.google.cloud.asset.v1.ICreateFeedRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createFeed(request, options, callback); + } +/** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @param {object} [options] + * 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 {@link protos.google.cloud.asset.v1.Feed|Feed}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.get_feed.js + * region_tag:cloudasset_v1_generated_AssetService_GetFeed_async + */ + getFeed( + request?: protos.google.cloud.asset.v1.IGetFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest|undefined, {}|undefined + ]>; + getFeed( + request: protos.google.cloud.asset.v1.IGetFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest|null|undefined, + {}|null|undefined>): void; + getFeed( + request: protos.google.cloud.asset.v1.IGetFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest|null|undefined, + {}|null|undefined>): void; + getFeed( + request?: protos.google.cloud.asset.v1.IGetFeedRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getFeed(request, options, callback); + } +/** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {object} [options] + * 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 {@link protos.google.cloud.asset.v1.ListFeedsResponse|ListFeedsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.list_feeds.js + * region_tag:cloudasset_v1_generated_AssetService_ListFeeds_async + */ + listFeeds( + request?: protos.google.cloud.asset.v1.IListFeedsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest|undefined, {}|undefined + ]>; + listFeeds( + request: protos.google.cloud.asset.v1.IListFeedsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest|null|undefined, + {}|null|undefined>): void; + listFeeds( + request: protos.google.cloud.asset.v1.IListFeedsRequest, + callback: Callback< + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest|null|undefined, + {}|null|undefined>): void; + listFeeds( + request?: protos.google.cloud.asset.v1.IListFeedsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listFeeds(request, options, callback); + } +/** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.Feed} request.feed + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.Feed|Feed}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.update_feed.js + * region_tag:cloudasset_v1_generated_AssetService_UpdateFeed_async + */ + updateFeed( + request?: protos.google.cloud.asset.v1.IUpdateFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest|undefined, {}|undefined + ]>; + updateFeed( + request: protos.google.cloud.asset.v1.IUpdateFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest|null|undefined, + {}|null|undefined>): void; + updateFeed( + request: protos.google.cloud.asset.v1.IUpdateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest|null|undefined, + {}|null|undefined>): void; + updateFeed( + request?: protos.google.cloud.asset.v1.IUpdateFeedRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'feed.name': request.feed!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateFeed(request, options, callback); + } +/** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @param {object} [options] + * 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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.delete_feed.js + * region_tag:cloudasset_v1_generated_AssetService_DeleteFeed_async + */ + deleteFeed( + request?: protos.google.cloud.asset.v1.IDeleteFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest|undefined, {}|undefined + ]>; + deleteFeed( + request: protos.google.cloud.asset.v1.IDeleteFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest|null|undefined, + {}|null|undefined>): void; + deleteFeed( + request: protos.google.cloud.asset.v1.IDeleteFeedRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest|null|undefined, + {}|null|undefined>): void; + deleteFeed( + request?: protos.google.cloud.asset.v1.IDeleteFeedRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteFeed(request, options, callback); + } +/** + * Analyzes IAM policies to answer which identities have what accesses on + * which resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {string} [request.savedAnalysisQuery] + * Optional. The name of a saved query, which must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * page. + * + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * @param {google.protobuf.Duration} [request.executionTimeout] + * Optional. Amount of time executable has to complete. See JSON + * representation of + * [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. + * @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 {@link protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.analyze_iam_policy.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_async + */ + analyzeIamPolicy( + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest|undefined, {}|undefined + ]>; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + analyzeIamPolicy( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + analyzeIamPolicy( + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'analysis_query.scope': request.analysisQuery!.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.analyzeIamPolicy(request, options, callback); + } +/** + * Analyze moving a resource to a specified destination without kicking off + * the actual move. The analysis is best effort depending on the user's + * permissions of viewing different hierarchical policies and configurations. + * The policies and configuration are subject to change before the actual + * resource migration takes place. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * Required. Name of the resource to perform the analysis against. + * Only Google Cloud projects are supported as of today. Hence, this can only + * be a project ID (such as "projects/my-project-id") or a project number + * (such as "projects/12345"). + * @param {string} request.destinationParent + * Required. Name of the Google Cloud folder or organization to reparent the + * target resource. The analysis will be performed against hypothetically + * moving the resource to this specified desitination parent. This can only be + * a folder number (such as "folders/123") or an organization number (such as + * "organizations/123"). + * @param {google.cloud.asset.v1.AnalyzeMoveRequest.AnalysisView} request.view + * Analysis view indicating what information should be included in the + * analysis response. If unspecified, the default view is FULL. + * @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 {@link protos.google.cloud.asset.v1.AnalyzeMoveResponse|AnalyzeMoveResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.analyze_move.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeMove_async + */ + analyzeMove( + request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest|undefined, {}|undefined + ]>; + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest|null|undefined, + {}|null|undefined>): void; + analyzeMove( + request: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + callback: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest|null|undefined, + {}|null|undefined>): void; + analyzeMove( + request?: protos.google.cloud.asset.v1.IAnalyzeMoveRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'resource': request.resource ?? '', + }); + this.initialize(); + return this.innerApiCalls.analyzeMove(request, options, callback); + } +/** + * Issue a job that queries assets using a SQL statement compatible with + * [BigQuery SQL](https://cloud.google.com/bigquery/docs/introduction-sql). + * + * If the query execution finishes within timeout and there's no pagination, + * the full query results will be returned in the `QueryAssetsResponse`. + * + * Otherwise, full query results can be obtained by issuing extra requests + * with the `job_reference` from the a previous `QueryAssets` call. + * + * Note, the query result has approximately 10 GB limitation enforced by + * [BigQuery](https://cloud.google.com/bigquery/docs/best-practices-performance-output). + * Queries return larger results will result in errors. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * + * Only assets belonging to the `parent` will be returned. + * @param {string} [request.statement] + * Optional. A SQL statement that's compatible with [BigQuery + * SQL](https://cloud.google.com/bigquery/docs/introduction-sql). + * @param {string} [request.jobReference] + * Optional. Reference to the query job, which is from the + * `QueryAssetsResponse` of previous `QueryAssets` call. + * @param {number} [request.pageSize] + * Optional. The maximum number of rows to return in the results. Responses + * are limited to 10 MB and 1000 rows. + * + * By default, the maximum row count is 1000. When the byte or row count limit + * is reached, the rest of the query results will be paginated. + * + * The field will be ignored when [output_config] is specified. + * @param {string} [request.pageToken] + * Optional. A page token received from previous `QueryAssets`. + * + * The field will be ignored when [output_config] is specified. + * @param {google.protobuf.Duration} [request.timeout] + * Optional. Specifies the maximum amount of time that the client is willing + * to wait for the query to complete. By default, this limit is 5 min for the + * first query, and 1 minute for the following queries. If the query is + * complete, the `done` field in the `QueryAssetsResponse` is true, otherwise + * false. + * + * Like BigQuery [jobs.query + * API](https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#queryrequest) + * The call is not guaranteed to wait for the specified timeout; it typically + * returns after around 200 seconds (200,000 milliseconds), even if the query + * is not complete. + * + * The field will be ignored when [output_config] is specified. + * @param {google.cloud.asset.v1.TimeWindow} [request.readTimeWindow] + * Optional. [start_time] is required. [start_time] must be less than + * [end_time] Defaults [end_time] to now if [start_time] is set and + * [end_time] isn't. Maximum permitted time range is 7 days. + * @param {google.protobuf.Timestamp} [request.readTime] + * Optional. Queries cloud assets as they appeared at the specified point in + * time. + * @param {google.cloud.asset.v1.QueryAssetsOutputConfig} [request.outputConfig] + * Optional. Destination where the query results will be saved. + * + * When this field is specified, the query results won't be saved in the + * [QueryAssetsResponse.query_result]. Instead + * [QueryAssetsResponse.output_config] will be set. + * + * Meanwhile, [QueryAssetsResponse.job_reference] will be set and can be used + * to check the status of the query job when passed to a following + * [QueryAssets] API call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.QueryAssetsResponse|QueryAssetsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.query_assets.js + * region_tag:cloudasset_v1_generated_AssetService_QueryAssets_async + */ + queryAssets( + request?: protos.google.cloud.asset.v1.IQueryAssetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest|undefined, {}|undefined + ]>; + queryAssets( + request: protos.google.cloud.asset.v1.IQueryAssetsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest|null|undefined, + {}|null|undefined>): void; + queryAssets( + request: protos.google.cloud.asset.v1.IQueryAssetsRequest, + callback: Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest|null|undefined, + {}|null|undefined>): void; + queryAssets( + request?: protos.google.cloud.asset.v1.IQueryAssetsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.queryAssets(request, options, callback); + } +/** + * Creates a saved query in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this + * saved_query should be created in. It can only be an organization number + * (such as "organizations/123"), a folder number (such as "folders/123"), a + * project ID (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery + * Required. The saved_query details. The `name` field must be empty as it + * will be generated based on the parent and saved_query_id. + * @param {string} request.savedQueryId + * Required. The ID to use for the saved query, which must be unique in the + * specified parent. It will become the final component of the saved query's + * resource name. + * + * This value should be 4-63 characters, and valid characters + * are `{@link protos.0-9|a-z}-`. + * + * Notice that this field is required in the saved query creation, and the + * `name` field of the `saved_query` will be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.create_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_CreateSavedQuery_async + */ + createSavedQuery( + request?: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest|undefined, {}|undefined + ]>; + createSavedQuery( + request: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest|null|undefined, + {}|null|undefined>): void; + createSavedQuery( + request: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest|null|undefined, + {}|null|undefined>): void; + createSavedQuery( + request?: protos.google.cloud.asset.v1.ICreateSavedQueryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createSavedQuery(request, options, callback); + } +/** + * Gets details about a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the saved query and it must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.get_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_GetSavedQuery_async + */ + getSavedQuery( + request?: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest|undefined, {}|undefined + ]>; + getSavedQuery( + request: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest|null|undefined, + {}|null|undefined>): void; + getSavedQuery( + request: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest|null|undefined, + {}|null|undefined>): void; + getSavedQuery( + request?: protos.google.cloud.asset.v1.IGetSavedQueryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSavedQuery(request, options, callback); + } +/** + * Updates a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.SavedQuery} request.savedQuery + * Required. The saved query to update. + * + * The saved query's `name` field is used to identify the one to update, + * which has format as below: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.update_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_UpdateSavedQuery_async + */ + updateSavedQuery( + request?: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest|undefined, {}|undefined + ]>; + updateSavedQuery( + request: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest|null|undefined, + {}|null|undefined>): void; + updateSavedQuery( + request: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + callback: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest|null|undefined, + {}|null|undefined>): void; + updateSavedQuery( + request?: protos.google.cloud.asset.v1.IUpdateSavedQueryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'saved_query.name': request.savedQuery!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateSavedQuery(request, options, callback); + } +/** + * Deletes a saved query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the saved query to delete. It must be in the format + * of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.delete_saved_query.js + * region_tag:cloudasset_v1_generated_AssetService_DeleteSavedQuery_async + */ + deleteSavedQuery( + request?: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest|undefined, {}|undefined + ]>; + deleteSavedQuery( + request: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest|null|undefined, + {}|null|undefined>): void; + deleteSavedQuery( + request: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest|null|undefined, + {}|null|undefined>): void; + deleteSavedQuery( + request?: protos.google.cloud.asset.v1.IDeleteSavedQueryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSavedQuery(request, options, callback); + } +/** + * Gets effective IAM policies for a batch of resources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. Only IAM policies on or below the scope will be returned. + * + * This can only be an organization number (such as "organizations/123"), a + * folder number (such as "folders/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"). + * + * To know how to get organization ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id). + * + * To know how to get folder or project ID, visit [here + * ](https://cloud.google.com/resource-manager/docs/creating-managing-folders#viewing_or_listing_folders_and_projects). + * @param {string[]} request.names + * Required. The names refer to the [full_resource_names] + * (https://cloud.google.com/asset-inventory/docs/resource-name-format) + * of the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * A maximum of 20 resources' effective policies can be retrieved in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse|BatchGetEffectiveIamPoliciesResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.batch_get_effective_iam_policies.js + * region_tag:cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_async + */ + batchGetEffectiveIamPolicies( + request?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest|undefined, {}|undefined + ]>; + batchGetEffectiveIamPolicies( + request: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest|null|undefined, + {}|null|undefined>): void; + batchGetEffectiveIamPolicies( + request: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, + callback: Callback< + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest|null|undefined, + {}|null|undefined>): void; + batchGetEffectiveIamPolicies( + request?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.batchGetEffectiveIamPolicies(request, options, callback); + } + +/** + * Exports assets with time and resource types to a given Cloud Storage + * location/BigQuery table. For Cloud Storage location destinations, the + * output format is newline-delimited JSON. Each line represents a + * {@link protos.google.cloud.asset.v1.Asset|google.cloud.asset.v1.Asset} in the JSON + * format; for BigQuery table destinations, the output table stores the fields + * in asset Protobuf as columns. This API implements the + * {@link protos.google.longrunning.Operation|google.longrunning.Operation} API, which + * allows you to keep track of the export. We recommend intervals of at least + * 2 seconds with exponential retry to poll the export operation result. For + * regular-size resource parent, the export operation usually finishes within + * 5 minutes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. + * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. + * @param {string[]} request.relationshipTypes + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.export_assets.js + * region_tag:cloudasset_v1_generated_AssetService_ExportAssets_async + */ + exportAssets( + request?: protos.google.cloud.asset.v1.IExportAssetsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportAssets( + request: protos.google.cloud.asset.v1.IExportAssetsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportAssets( + request: protos.google.cloud.asset.v1.IExportAssetsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportAssets( + request?: protos.google.cloud.asset.v1.IExportAssetsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.exportAssets(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportAssets()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.export_assets.js + * region_tag:cloudasset_v1_generated_AssetService_ExportAssets_async + */ + async checkExportAssetsProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportAssets, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Analyzes IAM policies asynchronously to answer which identities have what + * accesses on which resources, and writes the analysis results to a Google + * Cloud Storage or a BigQuery destination. For Cloud Storage destination, the + * output format is the JSON format that represents a + * {@link protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse|AnalyzeIamPolicyResponse}. + * This method implements the + * {@link protos.google.longrunning.Operation|google.longrunning.Operation}, which allows + * you to track the operation status. We recommend intervals of at least 2 + * seconds with exponential backoff retry to poll the operation result. The + * metadata contains the metadata for the long-running operation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1.IamPolicyAnalysisQuery} request.analysisQuery + * Required. The request query. + * @param {string} [request.savedAnalysisQuery] + * Optional. The name of a saved query, which must be in the format of: + * + * * projects/project_number/savedQueries/saved_query_id + * * folders/folder_number/savedQueries/saved_query_id + * * organizations/organization_number/savedQueries/saved_query_id + * + * If both `analysis_query` and `saved_analysis_query` are provided, they + * will be merged together with the `saved_analysis_query` as base and + * the `analysis_query` as overrides. For more details of the merge behavior, + * refer to the + * [MergeFrom](https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.message#Message.MergeFrom.details) + * doc. + * + * Note that you cannot override primitive fields with default value, such as + * 0 or empty string, etc., because we use proto3, which doesn't support field + * presence yet. + * @param {google.cloud.asset.v1.IamPolicyAnalysisOutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async + */ + analyzeIamPolicyLongrunning( + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + analyzeIamPolicyLongrunning( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + analyzeIamPolicyLongrunning( + request: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + analyzeIamPolicyLongrunning( + request?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'analysis_query.scope': request.analysisQuery!.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.analyzeIamPolicyLongrunning(request, options, callback); + } +/** + * Check the status of the long running operation returned by `analyzeIamPolicyLongrunning()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_async + */ + async checkAnalyzeIamPolicyLongrunningProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.analyzeIamPolicyLongrunning, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists assets with time and resource types and returns paged results in + * response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1.Asset|Asset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAssets( + request?: protos.google.cloud.asset.v1.IListAssetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IAsset[], + protos.google.cloud.asset.v1.IListAssetsRequest|null, + protos.google.cloud.asset.v1.IListAssetsResponse + ]>; + listAssets( + request: protos.google.cloud.asset.v1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse|null|undefined, + protos.google.cloud.asset.v1.IAsset>): void; + listAssets( + request: protos.google.cloud.asset.v1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse|null|undefined, + protos.google.cloud.asset.v1.IAsset>): void; + listAssets( + request?: protos.google.cloud.asset.v1.IListAssetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse|null|undefined, + protos.google.cloud.asset.v1.IAsset>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse|null|undefined, + protos.google.cloud.asset.v1.IAsset>): + Promise<[ + protos.google.cloud.asset.v1.IAsset[], + protos.google.cloud.asset.v1.IListAssetsRequest|null, + protos.google.cloud.asset.v1.IListAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAssets(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1.Asset|Asset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAssetsStream( + request?: protos.google.cloud.asset.v1.IListAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAssets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization, folder, or project the assets belong + * to. Format: "organizations/[organization-number]" (such as + * "organizations/123"), "projects/[project-id]" (such as + * "projects/my-project-id"), "projects/[project-number]" (such as + * "projects/12345"), or "folders/[folder-number]" (such as "folders/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1.Asset|Asset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.list_assets.js + * region_tag:cloudasset_v1_generated_AssetService_ListAssets_async + */ + listAssetsAsync( + request?: protos.google.cloud.asset.v1.IListAssetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Searches all Google Cloud resources within the specified scope, such as a + * project, folder, or organization. The caller must be granted the + * `cloudasset.assets.searchAllResources` permission on the desired scope, + * otherwise the request will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} [request.query] + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * + * Examples: + * + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only the following fields in the response are sortable: + * + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. A comma-separated list of fields that you want returned in the + * results. The following fields are returned by default if not specified: + * + * * `name` + * * `assetType` + * * `project` + * * `folders` + * * `organization` + * * `displayName` + * * `description` + * * `location` + * * `labels` + * * `tags` + * * `effectiveTags` + * * `networkTags` + * * `kmsKeys` + * * `createTime` + * * `updateTime` + * * `state` + * * `additionalAttributes` + * * `parentFullResourceName` + * * `parentAssetType` + * + * Some fields of large size, such as `versionedResources`, + * `attachedResources`, `effectiveTags` etc., are not returned by default, but + * you can specify them in the `read_mask` parameter if you want to include + * them. If `"*"` is specified, all [available + * fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + * are returned. + * Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + * Any invalid field path will trigger INVALID_ARGUMENT error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1.ResourceSearchResult|ResourceSearchResult}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchAllResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAllResources( + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IResourceSearchResult[], + protos.google.cloud.asset.v1.ISearchAllResourcesRequest|null, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse + ]>; + searchAllResources( + request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse|null|undefined, + protos.google.cloud.asset.v1.IResourceSearchResult>): void; + searchAllResources( + request: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse|null|undefined, + protos.google.cloud.asset.v1.IResourceSearchResult>): void; + searchAllResources( + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse|null|undefined, + protos.google.cloud.asset.v1.IResourceSearchResult>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse|null|undefined, + protos.google.cloud.asset.v1.IResourceSearchResult>): + Promise<[ + protos.google.cloud.asset.v1.IResourceSearchResult[], + protos.google.cloud.asset.v1.ISearchAllResourcesRequest|null, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchAllResources(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} [request.query] + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * + * Examples: + * + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only the following fields in the response are sortable: + * + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. A comma-separated list of fields that you want returned in the + * results. The following fields are returned by default if not specified: + * + * * `name` + * * `assetType` + * * `project` + * * `folders` + * * `organization` + * * `displayName` + * * `description` + * * `location` + * * `labels` + * * `tags` + * * `effectiveTags` + * * `networkTags` + * * `kmsKeys` + * * `createTime` + * * `updateTime` + * * `state` + * * `additionalAttributes` + * * `parentFullResourceName` + * * `parentAssetType` + * + * Some fields of large size, such as `versionedResources`, + * `attachedResources`, `effectiveTags` etc., are not returned by default, but + * you can specify them in the `read_mask` parameter if you want to include + * them. If `"*"` is specified, all [available + * fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + * are returned. + * Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + * Any invalid field path will trigger INVALID_ARGUMENT error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1.ResourceSearchResult|ResourceSearchResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchAllResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAllResourcesStream( + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['searchAllResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllResources.createStream( + this.innerApiCalls.searchAllResources as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchAllResources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the resources within the `scope`. The caller must be + * granted the + * [`cloudasset.assets.searchAllResources`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} [request.query] + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-resources#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * resources within the specified `scope`. + * + * Examples: + * + * * `name:Important` to find Google Cloud resources whose name contains + * `Important` as a word. + * * `name=Important` to find the Google Cloud resource whose name is exactly + * `Important`. + * * `displayName:Impor*` to find Google Cloud resources whose display name + * contains `Impor` as a prefix of any word in the field. + * * `location:us-west*` to find Google Cloud resources whose location + * contains both `us` and `west` as prefixes. + * * `labels:prod` to find Google Cloud resources whose labels contain `prod` + * as a key or value. + * * `labels.env:prod` to find Google Cloud resources that have a label `env` + * and its value is `prod`. + * * `labels.env:*` to find Google Cloud resources that have a label `env`. + * * `tagKeys:env` to find Google Cloud resources that have directly + * attached tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `tagValues:prod*` to find Google Cloud resources that have directly + * attached tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `tagValueIds=tagValues/123` to find Google Cloud resources that have + * directly attached tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `effectiveTagKeys:env` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagKey.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys#resource:-tagkey) + * contains `env`. + * * `effectiveTagValues:prod*` to find Google Cloud resources that have + * directly attached or inherited tags where the + * [`TagValue.namespacedName`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * contains a word prefixed by `prod`. + * * `effectiveTagValueIds=tagValues/123` to find Google Cloud resources that + * have directly attached or inherited tags where the + * [`TagValue.name`](https://cloud.google.com/resource-manager/reference/rest/v3/tagValues#resource:-tagvalue) + * is exactly `tagValues/123`. + * * `kmsKey:key` to find Google Cloud resources encrypted with a + * customer-managed encryption key whose name contains `key` as a word. This + * field is deprecated. Use the `kmsKeys` field to retrieve Cloud KMS + * key information. + * * `kmsKeys:key` to find Google Cloud resources encrypted with + * customer-managed encryption keys whose name contains the word `key`. + * * `relationships:instance-group-1` to find Google Cloud resources that have + * relationships with `instance-group-1` in the related resource name. + * * `relationships:INSTANCE_TO_INSTANCEGROUP` to find Compute Engine + * instances that have relationships of type `INSTANCE_TO_INSTANCEGROUP`. + * * `relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1` to find + * Compute Engine instances that have relationships with `instance-group-1` + * in the Compute Engine instance group resource name, for relationship type + * `INSTANCE_TO_INSTANCEGROUP`. + * * `sccSecurityMarks.key=value` to find Cloud resources that are attached + * with security marks whose key is `key` and value is `value`. + * * `sccSecurityMarks.key:*` to find Cloud resources that are attached with + * security marks whose key is `key`. + * * `state:ACTIVE` to find Google Cloud resources whose state contains + * `ACTIVE` as a word. + * * `NOT state:ACTIVE` to find Google Cloud resources whose state doesn't + * contain `ACTIVE` as a word. + * * `createTime<1609459200` to find Google Cloud resources that were created + * before `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `updateTime>1609459200` to find Google Cloud resources that were updated + * after `2021-01-01 00:00:00 UTC`. `1609459200` is the epoch timestamp of + * `2021-01-01 00:00:00 UTC` in seconds. + * * `Important` to find Google Cloud resources that contain `Important` as a + * word in any of the searchable fields. + * * `Impor*` to find Google Cloud resources that contain `Impor` as a prefix + * of any word in any of the searchable fields. + * * `Important location:(us-west1 OR global)` to find Google Cloud + * resources that contain `Important` as a word in any of the searchable + * fields and are also located in the `us-west1` region or the `global` + * location. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the asset types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types). + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "location DESC, name". + * Only the following fields in the response are sortable: + * + * * name + * * assetType + * * project + * * displayName + * * description + * * location + * * createTime + * * updateTime + * * state + * * parentFullResourceName + * * parentAssetType + * @param {google.protobuf.FieldMask} [request.readMask] + * Optional. A comma-separated list of fields that you want returned in the + * results. The following fields are returned by default if not specified: + * + * * `name` + * * `assetType` + * * `project` + * * `folders` + * * `organization` + * * `displayName` + * * `description` + * * `location` + * * `labels` + * * `tags` + * * `effectiveTags` + * * `networkTags` + * * `kmsKeys` + * * `createTime` + * * `updateTime` + * * `state` + * * `additionalAttributes` + * * `parentFullResourceName` + * * `parentAssetType` + * + * Some fields of large size, such as `versionedResources`, + * `attachedResources`, `effectiveTags` etc., are not returned by default, but + * you can specify them in the `read_mask` parameter if you want to include + * them. If `"*"` is specified, all [available + * fields](https://cloud.google.com/asset-inventory/docs/reference/rest/v1/TopLevel/searchAllResources#resourcesearchresult) + * are returned. + * Examples: `"name,location"`, `"name,versionedResources"`, `"*"`. + * Any invalid field path will trigger INVALID_ARGUMENT error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1.ResourceSearchResult|ResourceSearchResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.search_all_resources.js + * region_tag:cloudasset_v1_generated_AssetService_SearchAllResources_async + */ + searchAllResourcesAsync( + request?: protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['searchAllResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllResources.asyncIterate( + this.innerApiCalls['searchAllResources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Searches all IAM policies within the specified scope, such as a project, + * folder, or organization. The caller must be granted the + * `cloudasset.assets.searchAllIamPolicies` permission on the desired scope, + * otherwise the request will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} [request.query] + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). + * + * Examples: + * + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the asset + * types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1.IamPolicySearchResult|IamPolicySearchResult}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchAllIamPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAllIamPolicies( + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest|null, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + ]>; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult>): void; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult>): void; + searchAllIamPolicies( + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult>): + Promise<[ + protos.google.cloud.asset.v1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest|null, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchAllIamPolicies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} [request.query] + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). + * + * Examples: + * + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the asset + * types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1.IamPolicySearchResult|IamPolicySearchResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchAllIamPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAllIamPoliciesStream( + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['searchAllIamPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllIamPolicies.createStream( + this.innerApiCalls.searchAllIamPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchAllIamPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. A scope can be a project, a folder, or an organization. The + * search is limited to the IAM policies within the `scope`. The caller must + * be granted the + * [`cloudasset.assets.searchAllIamPolicies`](https://cloud.google.com/asset-inventory/docs/access-control#required_permissions) + * permission on the desired scope. + * + * The allowed values are: + * + * * projects/{PROJECT_ID} (e.g., "projects/foo-bar") + * * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") + * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} [request.query] + * Optional. The query statement. See [how to construct a + * query](https://cloud.google.com/asset-inventory/docs/searching-iam-policies#how_to_construct_a_query) + * for more information. If not specified or empty, it will search all the + * IAM policies within the specified `scope`. Note that the query string is + * compared against each IAM policy binding, including its principals, + * roles, and IAM conditions. The returned IAM policies will only + * contain the bindings that match your query. To learn more about the IAM + * policy structure, see the [IAM policy + * documentation](https://cloud.google.com/iam/help/allow-policies/structure). + * + * Examples: + * + * * `policy:amy@gmail.com` to find IAM policy bindings that specify user + * "amy@gmail.com". + * * `policy:roles/compute.admin` to find IAM policy bindings that specify + * the Compute Admin role. + * * `policy:comp*` to find IAM policy bindings that contain "comp" as a + * prefix of any word in the binding. + * * `policy.role.permissions:storage.buckets.update` to find IAM policy + * bindings that specify a role containing "storage.buckets.update" + * permission. Note that if callers don't have `iam.roles.get` access to a + * role's included permissions, policy bindings that specify this role will + * be dropped from the search results. + * * `policy.role.permissions:upd*` to find IAM policy bindings that specify a + * role containing "upd" as a prefix of any word in the role permission. + * Note that if callers don't have `iam.roles.get` access to a role's + * included permissions, policy bindings that specify this role will be + * dropped from the search results. + * * `resource:organizations/123456` to find IAM policy bindings + * that are set on "organizations/123456". + * * `resource=//cloudresourcemanager.googleapis.com/projects/myproject` to + * find IAM policy bindings that are set on the project named "myproject". + * * `Important` to find IAM policy bindings that contain "Important" as a + * word in any of the searchable fields (except for the included + * permissions). + * * `resource:(instance1 OR instance2) policy:amy` to find + * IAM policy bindings that are set on resources "instance1" or + * "instance2" and also specify user "amy". + * * `roles:roles/compute.admin` to find IAM policy bindings that specify the + * Compute Admin role. + * * `memberTypes:user` to find IAM policy bindings that contain the + * principal type "user". + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero or a negative value, + * server will pick an appropriate default. Returned results may be fewer than + * requested. When this happens, there could be more results as long as + * `next_page_token` is returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that the IAM policies are attached to. If + * empty, it will search the IAM policies that are attached to all the asset + * types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots IAM policies attached to asset type + * starts with "compute.googleapis.com". + * * ".*Instance" snapshots IAM policies attached to asset type ends with + * "Instance". + * * ".*Instance.*" snapshots IAM policies attached to asset type contains + * "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add " DESC" after the field + * name to indicate descending order. Redundant space characters are ignored. + * Example: "assetType DESC, resource". + * Only singular primitive fields in the response are sortable: + * * resource + * * assetType + * * project + * All the other fields such as repeated fields (e.g., `folders`) and + * non-primitive fields (e.g., `policy`) are not supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1.IamPolicySearchResult|IamPolicySearchResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.search_all_iam_policies.js + * region_tag:cloudasset_v1_generated_AssetService_SearchAllIamPolicies_async + */ + searchAllIamPoliciesAsync( + request?: protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['searchAllIamPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllIamPolicies.asyncIterate( + this.innerApiCalls['searchAllIamPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all saved queries in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSavedQueriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSavedQueries( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.ISavedQuery[], + protos.google.cloud.asset.v1.IListSavedQueriesRequest|null, + protos.google.cloud.asset.v1.IListSavedQueriesResponse + ]>; + listSavedQueries( + request: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.asset.v1.ISavedQuery>): void; + listSavedQueries( + request: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.asset.v1.ISavedQuery>): void; + listSavedQueries( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.asset.v1.ISavedQuery>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + protos.google.cloud.asset.v1.IListSavedQueriesResponse|null|undefined, + protos.google.cloud.asset.v1.ISavedQuery>): + Promise<[ + protos.google.cloud.asset.v1.ISavedQuery[], + protos.google.cloud.asset.v1.IListSavedQueriesRequest|null, + protos.google.cloud.asset.v1.IListSavedQueriesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSavedQueries(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSavedQueriesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSavedQueriesStream( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.createStream( + this.innerApiCalls.listSavedQueries as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listSavedQueries`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose savedQueries are to + * be listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {string} [request.filter] + * Optional. The expression to filter resources. + * The expression is a list of zero or more restrictions combined via logical + * operators `AND` and `OR`. When `AND` and `OR` are both used in the + * expression, parentheses must be appropriately used to group the + * combinations. The expression may also contain regular expressions. + * + * See https://google.aip.dev/160 for more information on the grammar. + * @param {number} [request.pageSize] + * Optional. The maximum number of saved queries to return per page. The + * service may return fewer than this value. If unspecified, at most 50 will + * be returned. The maximum value is 1000; values above 1000 will be coerced + * to 1000. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListSavedQueries` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListSavedQueries` must + * match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1.SavedQuery|SavedQuery}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.list_saved_queries.js + * region_tag:cloudasset_v1_generated_AssetService_ListSavedQueries_async + */ + listSavedQueriesAsync( + request?: protos.google.cloud.asset.v1.IListSavedQueriesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSavedQueries']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSavedQueries.asyncIterate( + this.innerApiCalls['listSavedQueries'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Analyzes organization policies under a scope. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results|AnalyzeOrgPoliciesResponse.org_policy_results}. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results|AnalyzeOrgPoliciesResponse.org_policy_results} + * will contain 20 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult|OrgPolicyResult}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `analyzeOrgPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + analyzeOrgPolicies( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult[], + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest|null, + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse + ]>; + analyzeOrgPolicies( + request: protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult>): void; + analyzeOrgPolicies( + request: protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult>): void; + analyzeOrgPolicies( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult>): + Promise<[ + protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult[], + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest|null, + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.analyzeOrgPolicies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results|AnalyzeOrgPoliciesResponse.org_policy_results}. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results|AnalyzeOrgPoliciesResponse.org_policy_results} + * will contain 20 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult|OrgPolicyResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `analyzeOrgPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + analyzeOrgPoliciesStream( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['analyzeOrgPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.analyzeOrgPolicies.createStream( + this.innerApiCalls.analyzeOrgPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `analyzeOrgPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze organization policies for. + * The response only contains analyzed organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results|AnalyzeOrgPoliciesResponse.org_policy_results}. + * Filtering is currently available for bare literal values and the following + * fields: + * * consolidated_policy.attached_resource + * * consolidated_policy.rules.enforce + * + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * consolidated_policy.attached_resource="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the Organization Policy results attached to "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.org_policy_results|AnalyzeOrgPoliciesResponse.org_policy_results} + * will contain 20 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult|OrgPolicyResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.analyze_org_policies.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeOrgPolicies_async + */ + analyzeOrgPoliciesAsync( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['analyzeOrgPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.analyzeOrgPolicies.asyncIterate( + this.innerApiCalls['analyzeOrgPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Analyzes organization policies governed containers (projects, folders or + * organization) under a scope. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers|AnalyzeOrgPolicyGovernedContainersResponse.governed_containers}. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers|AnalyzeOrgPolicyGovernedContainersResponse.governed_containers} + * will contain 100 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer|GovernedContainer}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `analyzeOrgPolicyGovernedContainersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + analyzeOrgPolicyGovernedContainers( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer[], + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest|null, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse + ]>; + analyzeOrgPolicyGovernedContainers( + request: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer>): void; + analyzeOrgPolicyGovernedContainers( + request: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer>): void; + analyzeOrgPolicyGovernedContainers( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer>): + Promise<[ + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer[], + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest|null, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.analyzeOrgPolicyGovernedContainers(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers|AnalyzeOrgPolicyGovernedContainersResponse.governed_containers}. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers|AnalyzeOrgPolicyGovernedContainersResponse.governed_containers} + * will contain 100 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer|GovernedContainer} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `analyzeOrgPolicyGovernedContainersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + analyzeOrgPolicyGovernedContainersStream( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['analyzeOrgPolicyGovernedContainers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream( + this.innerApiCalls.analyzeOrgPolicyGovernedContainers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `analyzeOrgPolicyGovernedContainers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output containers will + * also be limited to the ones governed by those in-scope organization + * policies. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze governed containers for. + * The analysis only contains organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers|AnalyzeOrgPolicyGovernedContainersResponse.governed_containers}. + * Filtering is currently available for bare literal values and the following + * fields: + * * parent + * * consolidated_policy.rules.enforce + * + * When filtering by a specific field, the only supported operator is `=`. + * For example, filtering by + * parent="//cloudresourcemanager.googleapis.com/folders/001" + * will return all the containers under "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.governed_containers|AnalyzeOrgPolicyGovernedContainersResponse.governed_containers} + * will contain 100 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer|GovernedContainer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.analyze_org_policy_governed_containers.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedContainers_async + */ + analyzeOrgPolicyGovernedContainersAsync( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['analyzeOrgPolicyGovernedContainers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate( + this.innerApiCalls['analyzeOrgPolicyGovernedContainers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Analyzes organization policies governed assets (Google Cloud resources or + * policies) under a scope. This RPC supports custom constraints and the + * following canned constraints: + * + * * constraints/ainotebooks.accessMode + * * constraints/ainotebooks.disableFileDownloads + * * constraints/ainotebooks.disableRootAccess + * * constraints/ainotebooks.disableTerminal + * * constraints/ainotebooks.environmentOptions + * * constraints/ainotebooks.requireAutoUpgradeSchedule + * * constraints/ainotebooks.restrictVpcNetworks + * * constraints/compute.disableGuestAttributesAccess + * * constraints/compute.disableInstanceDataAccessApis + * * constraints/compute.disableNestedVirtualization + * * constraints/compute.disableSerialPortAccess + * * constraints/compute.disableSerialPortLogging + * * constraints/compute.disableVpcExternalIpv6 + * * constraints/compute.requireOsLogin + * * constraints/compute.requireShieldedVm + * * constraints/compute.restrictLoadBalancerCreationForTypes + * * constraints/compute.restrictProtocolForwardingCreationForTypes + * * constraints/compute.restrictXpnProjectLienRemoval + * * constraints/compute.setNewProjectDefaultToZonalDNSOnly + * * constraints/compute.skipDefaultNetworkCreation + * * constraints/compute.trustedImageProjects + * * constraints/compute.vmCanIpForward + * * constraints/compute.vmExternalIpAccess + * * constraints/gcp.detailedAuditLoggingMode + * * constraints/gcp.resourceLocations + * * constraints/iam.allowedPolicyMemberDomains + * * constraints/iam.automaticIamGrantsForDefaultServiceAccounts + * * constraints/iam.disableServiceAccountCreation + * * constraints/iam.disableServiceAccountKeyCreation + * * constraints/iam.disableServiceAccountKeyUpload + * * constraints/iam.restrictCrossProjectServiceAccountLienRemoval + * * constraints/iam.serviceAccountKeyExpiryHours + * * constraints/resourcemanager.accessBoundaries + * * constraints/resourcemanager.allowedExportDestinations + * * constraints/sql.restrictAuthorizedNetworks + * * constraints/sql.restrictNoncompliantDiagnosticDataAccess + * * constraints/sql.restrictNoncompliantResourceCreation + * * constraints/sql.restrictPublicIp + * * constraints/storage.publicAccessPrevention + * * constraints/storage.restrictAuthTypes + * * constraints/storage.uniformBucketLevelAccess + * + * This RPC only returns either resources of types [supported by search + * APIs](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + * or IAM policies. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets|AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets}. + * + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets|AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets} + * will contain 100 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset|GovernedAsset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `analyzeOrgPolicyGovernedAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + analyzeOrgPolicyGovernedAssets( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset[], + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest|null, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse + ]>; + analyzeOrgPolicyGovernedAssets( + request: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset>): void; + analyzeOrgPolicyGovernedAssets( + request: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset>): void; + analyzeOrgPolicyGovernedAssets( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse|null|undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset>): + Promise<[ + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset[], + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest|null, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.analyzeOrgPolicyGovernedAssets(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets|AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets}. + * + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets|AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets} + * will contain 100 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset|GovernedAsset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `analyzeOrgPolicyGovernedAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + analyzeOrgPolicyGovernedAssetsStream( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['analyzeOrgPolicyGovernedAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream( + this.innerApiCalls.analyzeOrgPolicyGovernedAssets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `analyzeOrgPolicyGovernedAssets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The organization to scope the request. Only organization + * policies within the scope will be analyzed. The output assets will + * also be limited to the ones governed by those in-scope organization + * policies. + * + * * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") + * @param {string} request.constraint + * Required. The name of the constraint to analyze governed assets for. The + * analysis only contains analyzed organization policies for the provided + * constraint. + * @param {string} request.filter + * The expression to filter + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets|AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets}. + * + * For governed resources, filtering is currently available for bare literal + * values and the following fields: + * * governed_resource.project + * * governed_resource.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_resource.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_resource.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_resource.project="projects/12345678"` + * will return all the governed resources under "projects/12345678", + * including the project itself if applicable. + * + * For governed IAM policies, filtering is currently available for bare + * literal values and the following fields: + * * governed_iam_policy.project + * * governed_iam_policy.folders + * * consolidated_policy.rules.enforce + * When filtering by `governed_iam_policy.project` or + * `consolidated_policy.rules.enforce`, the only supported operator is `=`. + * When filtering by `governed_iam_policy.folders`, the supported operators + * are `=` and `:`. + * For example, filtering by `governed_iam_policy.folders:"folders/12345678"` + * will return all the governed IAM policies under "folders/001". + * @param {number} request.pageSize + * The maximum number of items to return per page. If unspecified, + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets|AnalyzeOrgPolicyGovernedAssetsResponse.governed_assets} + * will contain 100 items with a maximum of 200. + * @param {string} request.pageToken + * The pagination token to retrieve the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset|GovernedAsset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/asset_service.analyze_org_policy_governed_assets.js + * region_tag:cloudasset_v1_generated_AssetService_AnalyzeOrgPolicyGovernedAssets_async + */ + analyzeOrgPolicyGovernedAssetsAsync( + request?: protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['analyzeOrgPolicyGovernedAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate( + this.innerApiCalls['analyzeOrgPolicyGovernedAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified accessLevel resource name string. + * + * @param {string} access_policy + * @param {string} access_level + * @returns {string} Resource name string. + */ + accessLevelPath(accessPolicy:string,accessLevel:string) { + return this.pathTemplates.accessLevelPathTemplate.render({ + access_policy: accessPolicy, + access_level: accessLevel, + }); + } + + /** + * Parse the access_policy from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName).access_policy; + } + + /** + * Parse the access_level from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_level. + */ + matchAccessLevelFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName).access_level; + } + + /** + * Return a fully-qualified accessPolicy resource name string. + * + * @param {string} access_policy + * @returns {string} Resource name string. + */ + accessPolicyPath(accessPolicy:string) { + return this.pathTemplates.accessPolicyPathTemplate.render({ + access_policy: accessPolicy, + }); + } + + /** + * Parse the access_policy from AccessPolicy resource. + * + * @param {string} accessPolicyName + * A fully-qualified path representing AccessPolicy resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessPolicyName(accessPolicyName: string) { + return this.pathTemplates.accessPolicyPathTemplate.match(accessPolicyName).access_policy; + } + + /** + * Return a fully-qualified folderFeed resource name string. + * + * @param {string} folder + * @param {string} feed + * @returns {string} Resource name string. + */ + folderFeedPath(folder:string,feed:string) { + return this.pathTemplates.folderFeedPathTemplate.render({ + folder: folder, + feed: feed, + }); + } + + /** + * Parse the folder from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderFeedName(folderFeedName: string) { + return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).folder; + } + + /** + * Parse the feed from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromFolderFeedName(folderFeedName: string) { + return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).feed; + } + + /** + * Return a fully-qualified folderSavedQuery resource name string. + * + * @param {string} folder + * @param {string} saved_query + * @returns {string} Resource name string. + */ + folderSavedQueryPath(folder:string,savedQuery:string) { + return this.pathTemplates.folderSavedQueryPathTemplate.render({ + folder: folder, + saved_query: savedQuery, + }); + } + + /** + * Parse the folder from FolderSavedQuery resource. + * + * @param {string} folderSavedQueryName + * A fully-qualified path representing folder_saved_query resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderSavedQueryName(folderSavedQueryName: string) { + return this.pathTemplates.folderSavedQueryPathTemplate.match(folderSavedQueryName).folder; + } + + /** + * Parse the saved_query from FolderSavedQuery resource. + * + * @param {string} folderSavedQueryName + * A fully-qualified path representing folder_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromFolderSavedQueryName(folderSavedQueryName: string) { + return this.pathTemplates.folderSavedQueryPathTemplate.match(folderSavedQueryName).saved_query; + } + + /** + * Return a fully-qualified inventory resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + inventoryPath(project:string,location:string,instance:string) { + return this.pathTemplates.inventoryPathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName).project; + } + + /** + * Parse the location from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName).location; + } + + /** + * Parse the instance from Inventory resource. + * + * @param {string} inventoryName + * A fully-qualified path representing Inventory resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInventoryName(inventoryName: string) { + return this.pathTemplates.inventoryPathTemplate.match(inventoryName).instance; + } + + /** + * Return a fully-qualified organizationFeed resource name string. + * + * @param {string} organization + * @param {string} feed + * @returns {string} Resource name string. + */ + organizationFeedPath(organization:string,feed:string) { + return this.pathTemplates.organizationFeedPathTemplate.render({ + organization: organization, + feed: feed, + }); + } + + /** + * Parse the organization from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationFeedName(organizationFeedName: string) { + return this.pathTemplates.organizationFeedPathTemplate.match(organizationFeedName).organization; + } + + /** + * Parse the feed from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromOrganizationFeedName(organizationFeedName: string) { + return this.pathTemplates.organizationFeedPathTemplate.match(organizationFeedName).feed; + } + + /** + * Return a fully-qualified organizationSavedQuery resource name string. + * + * @param {string} organization + * @param {string} saved_query + * @returns {string} Resource name string. + */ + organizationSavedQueryPath(organization:string,savedQuery:string) { + return this.pathTemplates.organizationSavedQueryPathTemplate.render({ + organization: organization, + saved_query: savedQuery, + }); + } + + /** + * Parse the organization from OrganizationSavedQuery resource. + * + * @param {string} organizationSavedQueryName + * A fully-qualified path representing organization_saved_query resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationSavedQueryName(organizationSavedQueryName: string) { + return this.pathTemplates.organizationSavedQueryPathTemplate.match(organizationSavedQueryName).organization; + } + + /** + * Parse the saved_query from OrganizationSavedQuery resource. + * + * @param {string} organizationSavedQueryName + * A fully-qualified path representing organization_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromOrganizationSavedQueryName(organizationSavedQueryName: string) { + return this.pathTemplates.organizationSavedQueryPathTemplate.match(organizationSavedQueryName).saved_query; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project:string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectFeed resource name string. + * + * @param {string} project + * @param {string} feed + * @returns {string} Resource name string. + */ + projectFeedPath(project:string,feed:string) { + return this.pathTemplates.projectFeedPathTemplate.render({ + project: project, + feed: feed, + }); + } + + /** + * Parse the project from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectFeedName(projectFeedName: string) { + return this.pathTemplates.projectFeedPathTemplate.match(projectFeedName).project; + } + + /** + * Parse the feed from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromProjectFeedName(projectFeedName: string) { + return this.pathTemplates.projectFeedPathTemplate.match(projectFeedName).feed; + } + + /** + * Return a fully-qualified projectSavedQuery resource name string. + * + * @param {string} project + * @param {string} saved_query + * @returns {string} Resource name string. + */ + projectSavedQueryPath(project:string,savedQuery:string) { + return this.pathTemplates.projectSavedQueryPathTemplate.render({ + project: project, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from ProjectSavedQuery resource. + * + * @param {string} projectSavedQueryName + * A fully-qualified path representing project_saved_query resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectSavedQueryName(projectSavedQueryName: string) { + return this.pathTemplates.projectSavedQueryPathTemplate.match(projectSavedQueryName).project; + } + + /** + * Parse the saved_query from ProjectSavedQuery resource. + * + * @param {string} projectSavedQueryName + * A fully-qualified path representing project_saved_query resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromProjectSavedQueryName(projectSavedQueryName: string) { + return this.pathTemplates.projectSavedQueryPathTemplate.match(projectSavedQueryName).saved_query; + } + + /** + * Return a fully-qualified servicePerimeter resource name string. + * + * @param {string} access_policy + * @param {string} service_perimeter + * @returns {string} Resource name string. + */ + servicePerimeterPath(accessPolicy:string,servicePerimeter:string) { + return this.pathTemplates.servicePerimeterPathTemplate.render({ + access_policy: accessPolicy, + service_perimeter: servicePerimeter, + }); + } + + /** + * Parse the access_policy from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match(servicePerimeterName).access_policy; + } + + /** + * Parse the service_perimeter from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the service_perimeter. + */ + matchServicePerimeterFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match(servicePerimeterName).service_perimeter; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_client_config.json b/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_client_config.json new file mode 100644 index 00000000000..c9b0eb0854a --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_client_config.json @@ -0,0 +1,143 @@ +{ + "interfaces": { + "google.cloud.asset.v1.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": { + "ExportAssets": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListAssets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchGetAssetsHistory": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "CreateFeed": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFeed": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFeeds": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFeed": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFeed": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAllResources": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SearchAllIamPolicies": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "AnalyzeIamPolicy": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "AnalyzeIamPolicyLongrunning": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AnalyzeMove": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryAssets": { + "timeout_millis": 200000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateSavedQuery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetSavedQuery": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListSavedQueries": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateSavedQuery": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSavedQuery": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "BatchGetEffectiveIamPolicies": { + "timeout_millis": 300000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "AnalyzeOrgPolicies": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnalyzeOrgPolicyGovernedContainers": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "AnalyzeOrgPolicyGovernedAssets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_proto_list.json b/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_proto_list.json new file mode 100644 index 00000000000..d519d6bffd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/src/v1/asset_service_proto_list.json @@ -0,0 +1,10 @@ +[ + "../../protos/google/cloud/asset/v1/asset_service.proto", + "../../protos/google/cloud/asset/v1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/cloud/osconfig/v1/inventory.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" +] diff --git a/owl-bot-staging/google-cloud-asset/v1/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-asset/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..6051505401d --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/src/v1/gapic_metadata.json @@ -0,0 +1,281 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1", + "libraryPackage": "@google-cloud/asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "BatchGetAssetsHistory": { + "methods": [ + "batchGetAssetsHistory" + ] + }, + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + }, + "AnalyzeIamPolicy": { + "methods": [ + "analyzeIamPolicy" + ] + }, + "AnalyzeMove": { + "methods": [ + "analyzeMove" + ] + }, + "QueryAssets": { + "methods": [ + "queryAssets" + ] + }, + "CreateSavedQuery": { + "methods": [ + "createSavedQuery" + ] + }, + "GetSavedQuery": { + "methods": [ + "getSavedQuery" + ] + }, + "UpdateSavedQuery": { + "methods": [ + "updateSavedQuery" + ] + }, + "DeleteSavedQuery": { + "methods": [ + "deleteSavedQuery" + ] + }, + "BatchGetEffectiveIamPolicies": { + "methods": [ + "batchGetEffectiveIamPolicies" + ] + }, + "ExportAssets": { + "methods": [ + "exportAssets" + ] + }, + "AnalyzeIamPolicyLongrunning": { + "methods": [ + "analyzeIamPolicyLongrunning" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "SearchAllResources": { + "methods": [ + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" + ] + }, + "SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" + ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] + }, + "AnalyzeOrgPolicies": { + "methods": [ + "analyzeOrgPolicies", + "analyzeOrgPoliciesStream", + "analyzeOrgPoliciesAsync" + ] + }, + "AnalyzeOrgPolicyGovernedContainers": { + "methods": [ + "analyzeOrgPolicyGovernedContainers", + "analyzeOrgPolicyGovernedContainersStream", + "analyzeOrgPolicyGovernedContainersAsync" + ] + }, + "AnalyzeOrgPolicyGovernedAssets": { + "methods": [ + "analyzeOrgPolicyGovernedAssets", + "analyzeOrgPolicyGovernedAssetsStream", + "analyzeOrgPolicyGovernedAssetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "BatchGetAssetsHistory": { + "methods": [ + "batchGetAssetsHistory" + ] + }, + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + }, + "AnalyzeIamPolicy": { + "methods": [ + "analyzeIamPolicy" + ] + }, + "AnalyzeMove": { + "methods": [ + "analyzeMove" + ] + }, + "QueryAssets": { + "methods": [ + "queryAssets" + ] + }, + "CreateSavedQuery": { + "methods": [ + "createSavedQuery" + ] + }, + "GetSavedQuery": { + "methods": [ + "getSavedQuery" + ] + }, + "UpdateSavedQuery": { + "methods": [ + "updateSavedQuery" + ] + }, + "DeleteSavedQuery": { + "methods": [ + "deleteSavedQuery" + ] + }, + "BatchGetEffectiveIamPolicies": { + "methods": [ + "batchGetEffectiveIamPolicies" + ] + }, + "ExportAssets": { + "methods": [ + "exportAssets" + ] + }, + "AnalyzeIamPolicyLongrunning": { + "methods": [ + "analyzeIamPolicyLongrunning" + ] + }, + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + }, + "SearchAllResources": { + "methods": [ + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" + ] + }, + "SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" + ] + }, + "ListSavedQueries": { + "methods": [ + "listSavedQueries", + "listSavedQueriesStream", + "listSavedQueriesAsync" + ] + }, + "AnalyzeOrgPolicies": { + "methods": [ + "analyzeOrgPolicies", + "analyzeOrgPoliciesStream", + "analyzeOrgPoliciesAsync" + ] + }, + "AnalyzeOrgPolicyGovernedContainers": { + "methods": [ + "analyzeOrgPolicyGovernedContainers", + "analyzeOrgPolicyGovernedContainersStream", + "analyzeOrgPolicyGovernedContainersAsync" + ] + }, + "AnalyzeOrgPolicyGovernedAssets": { + "methods": [ + "analyzeOrgPolicyGovernedAssets", + "analyzeOrgPolicyGovernedAssetsStream", + "analyzeOrgPolicyGovernedAssetsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1/src/v1/index.ts b/owl-bot-staging/google-cloud-asset/v1/src/v1/index.ts new file mode 100644 index 00000000000..f87a8e44978 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 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/owl-bot-staging/google-cloud-asset/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-asset/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..997ccf2219e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const asset = require('@google-cloud/asset'); + +function main() { + const assetServiceClient = new asset.AssetServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-asset/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..1794fc57ef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AssetServiceClient} from '@google-cloud/asset'; + +// check that the client class type name can be used +function doStuffWithAssetServiceClient(client: AssetServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const assetServiceClient = new AssetServiceClient(); + doStuffWithAssetServiceClient(assetServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1/system-test/install.ts b/owl-bot-staging/google-cloud-asset/v1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-asset/v1/test/gapic_asset_service_v1.ts b/owl-bot-staging/google-cloud-asset/v1/test/gapic_asset_service_v1.ts new file mode 100644 index 00000000000..9823ab075a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/test/gapic_asset_service_v1.ts @@ -0,0 +1,4496 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as assetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.AssetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new assetserviceModule.v1.AssetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new assetserviceModule.v1.AssetServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = assetserviceModule.v1.AssetServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = assetserviceModule.v1.AssetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new assetserviceModule.v1.AssetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new assetserviceModule.v1.AssetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1.AssetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1.AssetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new assetserviceModule.v1.AssetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = assetserviceModule.v1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1.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 for the initialized client', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('batchGetAssetsHistory', () => { + it('invokes batchGetAssetsHistory without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() + ); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall(expectedResponse); + const [response] = await client.batchGetAssetsHistory(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetAssetsHistory without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() + ); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchGetAssetsHistory( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetAssetsHistory with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchGetAssetsHistory(request), expectedError); + const actualRequest = (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetAssetsHistory as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetAssetsHistory with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetAssetsHistoryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.BatchGetAssetsHistoryRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchGetAssetsHistory(request), expectedError); + }); + }); + + describe('createFeed', () => { + it('invokes createFeed without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.CreateFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.createFeed = stubSimpleCall(expectedResponse); + const [response] = await client.createFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFeed without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.CreateFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.createFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFeed( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IFeed|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFeed with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.CreateFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFeed with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.CreateFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFeed(request), expectedError); + }); + }); + + describe('getFeed', () => { + it('invokes getFeed without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.getFeed = stubSimpleCall(expectedResponse); + const [response] = await client.getFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFeed without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.getFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFeed( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IFeed|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFeed with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFeed with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFeed(request), expectedError); + }); + }); + + describe('listFeeds', () => { + it('invokes listFeeds without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsResponse() + ); + client.innerApiCalls.listFeeds = stubSimpleCall(expectedResponse); + const [response] = await client.listFeeds(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFeeds without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsResponse() + ); + client.innerApiCalls.listFeeds = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFeeds( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IListFeedsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFeeds with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeeds(request), expectedError); + const actualRequest = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFeeds with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListFeedsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listFeeds(request), expectedError); + }); + }); + + describe('updateFeed', () => { + it('invokes updateFeed without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateFeedRequest() + ); + request.feed ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.UpdateFeedRequest', ['feed', 'name']); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.updateFeed = stubSimpleCall(expectedResponse); + const [response] = await client.updateFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeed without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateFeedRequest() + ); + request.feed ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.UpdateFeedRequest', ['feed', 'name']); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.Feed() + ); + client.innerApiCalls.updateFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFeed( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IFeed|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeed with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateFeedRequest() + ); + request.feed ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.UpdateFeedRequest', ['feed', 'name']); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeed with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateFeedRequest() + ); + request.feed ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.UpdateFeedRequest', ['feed', 'name']); + request.feed.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFeed(request), expectedError); + }); + }); + + describe('deleteFeed', () => { + it('invokes deleteFeed without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFeed = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeed without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFeed( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeed with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeed with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteFeed(request), expectedError); + }); + }); + + describe('analyzeIamPolicy', () => { + it('invokes analyzeIamPolicy without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeIamPolicyRequest', ['analysisQuery', 'scope']); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() + ); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeIamPolicy without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeIamPolicyRequest', ['analysisQuery', 'scope']); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() + ); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeIamPolicy( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeIamPolicy with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeIamPolicyRequest', ['analysisQuery', 'scope']); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.analyzeIamPolicy(request), expectedError); + const actualRequest = (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeIamPolicy as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeIamPolicy with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyRequest() + ); + request.analysisQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeIamPolicyRequest', ['analysisQuery', 'scope']); + request.analysisQuery.scope = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeIamPolicy(request), expectedError); + }); + }); + + describe('analyzeMove', () => { + it('invokes analyzeMove without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeMoveRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveResponse() + ); + client.innerApiCalls.analyzeMove = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeMove(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeMove without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeMoveRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveResponse() + ); + client.innerApiCalls.analyzeMove = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeMove( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IAnalyzeMoveResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeMove with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeMoveRequest', ['resource']); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeMove = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.analyzeMove(request), expectedError); + const actualRequest = (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeMove as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeMove with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeMoveRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeMoveRequest', ['resource']); + request.resource = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.analyzeMove(request), expectedError); + }); + }); + + describe('queryAssets', () => { + it('invokes queryAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.QueryAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsResponse() + ); + client.innerApiCalls.queryAssets = stubSimpleCall(expectedResponse); + const [response] = await client.queryAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.QueryAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsResponse() + ); + client.innerApiCalls.queryAssets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryAssets( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IQueryAssetsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.QueryAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryAssets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.queryAssets(request), expectedError); + const actualRequest = (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.queryAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryAssets with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.QueryAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.QueryAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryAssets(request), expectedError); + }); + }); + + describe('createSavedQuery', () => { + it('invokes createSavedQuery without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.CreateSavedQueryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.createSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.createSavedQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSavedQuery without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.CreateSavedQueryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.createSavedQuery = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSavedQuery( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.ISavedQuery|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSavedQuery with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.CreateSavedQueryRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSavedQuery = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createSavedQuery(request), expectedError); + const actualRequest = (client.innerApiCalls.createSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSavedQuery with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.CreateSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.CreateSavedQueryRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createSavedQuery(request), expectedError); + }); + }); + + describe('getSavedQuery', () => { + it('invokes getSavedQuery without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.GetSavedQueryRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.getSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.getSavedQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSavedQuery without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.GetSavedQueryRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.getSavedQuery = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSavedQuery( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.ISavedQuery|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSavedQuery with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.GetSavedQueryRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSavedQuery = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getSavedQuery(request), expectedError); + const actualRequest = (client.innerApiCalls.getSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSavedQuery with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.GetSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.GetSavedQueryRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSavedQuery(request), expectedError); + }); + }); + + describe('updateSavedQuery', () => { + it('invokes updateSavedQuery without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() + ); + request.savedQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.UpdateSavedQueryRequest', ['savedQuery', 'name']); + request.savedQuery.name = defaultValue1; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.updateSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.updateSavedQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSavedQuery without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() + ); + request.savedQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.UpdateSavedQueryRequest', ['savedQuery', 'name']); + request.savedQuery.name = defaultValue1; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.SavedQuery() + ); + client.innerApiCalls.updateSavedQuery = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSavedQuery( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.ISavedQuery|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSavedQuery with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() + ); + request.savedQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.UpdateSavedQueryRequest', ['savedQuery', 'name']); + request.savedQuery.name = defaultValue1; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSavedQuery = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateSavedQuery(request), expectedError); + const actualRequest = (client.innerApiCalls.updateSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSavedQuery with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.UpdateSavedQueryRequest() + ); + request.savedQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.UpdateSavedQueryRequest', ['savedQuery', 'name']); + request.savedQuery.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateSavedQuery(request), expectedError); + }); + }); + + describe('deleteSavedQuery', () => { + it('invokes deleteSavedQuery without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.DeleteSavedQueryRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSavedQuery = stubSimpleCall(expectedResponse); + const [response] = await client.deleteSavedQuery(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSavedQuery without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.DeleteSavedQueryRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteSavedQuery = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSavedQuery( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSavedQuery with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.DeleteSavedQueryRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSavedQuery = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteSavedQuery(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteSavedQuery as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSavedQuery with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.DeleteSavedQueryRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.DeleteSavedQueryRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteSavedQuery(request), expectedError); + }); + }); + + describe('batchGetEffectiveIamPolicies', () => { + it('invokes batchGetEffectiveIamPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() + ); + client.innerApiCalls.batchGetEffectiveIamPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.batchGetEffectiveIamPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetEffectiveIamPolicies without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() + ); + client.innerApiCalls.batchGetEffectiveIamPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchGetEffectiveIamPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetEffectiveIamPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchGetEffectiveIamPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.batchGetEffectiveIamPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.batchGetEffectiveIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchGetEffectiveIamPolicies with closed client', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchGetEffectiveIamPolicies(request), expectedError); + }); + }); + + describe('exportAssets', () => { + it('invokes exportAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ExportAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportAssets(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ExportAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportAssets( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAssets with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ExportAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportAssets(request), expectedError); + const actualRequest = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAssets with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ExportAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ExportAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportAssets(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportAssetsProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportAssetsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAssetsProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportAssetsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('analyzeIamPolicyLongrunning', () => { + it('invokes analyzeIamPolicyLongrunning without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest', ['analysisQuery', 'scope']); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall(expectedResponse); + const [operation] = await client.analyzeIamPolicyLongrunning(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeIamPolicyLongrunning without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest', ['analysisQuery', 'scope']); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeIamPolicyLongrunning( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeIamPolicyLongrunning with call error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest', ['analysisQuery', 'scope']); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.analyzeIamPolicyLongrunning(request), expectedError); + const actualRequest = (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeIamPolicyLongrunning with LRO error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest() + ); + request.analysisQuery ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningRequest', ['analysisQuery', 'scope']); + request.analysisQuery.scope = defaultValue1; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.analyzeIamPolicyLongrunning(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeIamPolicyLongrunning as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAnalyzeIamPolicyLongrunningProgress without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAnalyzeIamPolicyLongrunningProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAnalyzeIamPolicyLongrunningProgress with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkAnalyzeIamPolicyLongrunningProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IAsset[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAssets(request), expectedError); + const actualRequest = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.descriptors.page.listAssets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), + ]; + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.IAsset[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.IAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchAllResources', () => { + it('invokes searchAllResources without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + ]; + client.innerApiCalls.searchAllResources = stubSimpleCall(expectedResponse); + const [response] = await client.searchAllResources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllResources without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + ]; + client.innerApiCalls.searchAllResources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAllResources( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IResourceSearchResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllResources with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchAllResources(request), expectedError); + const actualRequest = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllResourcesStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + ]; + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchAllResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchAllResources, request)); + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchAllResourcesStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAllResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.ResourceSearchResult[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.ResourceSearchResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchAllResources, request)); + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllResources without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.ResourceSearchResult()), + ]; + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = []; + const iterable = client.searchAllResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllResources with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAllResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.IResourceSearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchAllIamPolicies', () => { + it('invokes searchAllIamPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + ]; + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.searchAllIamPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllIamPolicies without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + ]; + client.innerApiCalls.searchAllIamPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAllIamPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.IIamPolicySearchResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllIamPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchAllIamPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllIamPoliciesStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + ]; + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchAllIamPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchAllIamPolicies, request)); + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchAllIamPoliciesStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAllIamPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.IamPolicySearchResult[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.IamPolicySearchResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchAllIamPolicies, request)); + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllIamPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.IamPolicySearchResult()), + ]; + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; + const iterable = client.searchAllIamPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllIamPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAllIamPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.IIamPolicySearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSavedQueries', () => { + it('invokes listSavedQueries without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + ]; + client.innerApiCalls.listSavedQueries = stubSimpleCall(expectedResponse); + const [response] = await client.listSavedQueries(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueries without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + ]; + client.innerApiCalls.listSavedQueries = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSavedQueries( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.ISavedQuery[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueries with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSavedQueries = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listSavedQueries(request), expectedError); + const actualRequest = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listSavedQueries as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSavedQueriesStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + ]; + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listSavedQueriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.SavedQuery[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.SavedQuery) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSavedQueriesStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listSavedQueriesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.SavedQuery[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.SavedQuery) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listSavedQueries, request)); + assert( + (client.descriptors.page.listSavedQueries.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSavedQueries without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), + ]; + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.ISavedQuery[] = []; + const iterable = client.listSavedQueriesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSavedQueries with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.ListSavedQueriesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.ListSavedQueriesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSavedQueriesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.ISavedQuery[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listSavedQueries.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('analyzeOrgPolicies', () => { + it('invokes analyzeOrgPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + ]; + client.innerApiCalls.analyzeOrgPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeOrgPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPolicies without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + ]; + client.innerApiCalls.analyzeOrgPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeOrgPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeOrgPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.analyzeOrgPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPoliciesStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + ]; + client.descriptors.page.analyzeOrgPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.analyzeOrgPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.analyzeOrgPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.analyzeOrgPolicies, request)); + assert( + (client.descriptors.page.analyzeOrgPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes analyzeOrgPoliciesStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.analyzeOrgPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.analyzeOrgPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.analyzeOrgPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.analyzeOrgPolicies, request)); + assert( + (client.descriptors.page.analyzeOrgPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with analyzeOrgPolicies without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult()), + ]; + client.descriptors.page.analyzeOrgPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult[] = []; + const iterable = client.analyzeOrgPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.analyzeOrgPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.analyzeOrgPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with analyzeOrgPolicies with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.analyzeOrgPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.analyzeOrgPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.analyzeOrgPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.analyzeOrgPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('analyzeOrgPolicyGovernedContainers', () => { + it('invokes analyzeOrgPolicyGovernedContainers without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + ]; + client.innerApiCalls.analyzeOrgPolicyGovernedContainers = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeOrgPolicyGovernedContainers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicyGovernedContainers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicyGovernedContainers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPolicyGovernedContainers without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + ]; + client.innerApiCalls.analyzeOrgPolicyGovernedContainers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeOrgPolicyGovernedContainers( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicyGovernedContainers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicyGovernedContainers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPolicyGovernedContainers with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeOrgPolicyGovernedContainers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.analyzeOrgPolicyGovernedContainers(request), expectedError); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicyGovernedContainers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicyGovernedContainers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPolicyGovernedContainersStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + ]; + client.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.analyzeOrgPolicyGovernedContainersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.analyzeOrgPolicyGovernedContainers, request)); + assert( + (client.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes analyzeOrgPolicyGovernedContainersStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.analyzeOrgPolicyGovernedContainersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.analyzeOrgPolicyGovernedContainers, request)); + assert( + (client.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with analyzeOrgPolicyGovernedContainers without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer()), + ]; + client.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer[] = []; + const iterable = client.analyzeOrgPolicyGovernedContainersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with analyzeOrgPolicyGovernedContainers with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.analyzeOrgPolicyGovernedContainersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('analyzeOrgPolicyGovernedAssets', () => { + it('invokes analyzeOrgPolicyGovernedAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + ]; + client.innerApiCalls.analyzeOrgPolicyGovernedAssets = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeOrgPolicyGovernedAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicyGovernedAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicyGovernedAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPolicyGovernedAssets without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + ]; + client.innerApiCalls.analyzeOrgPolicyGovernedAssets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.analyzeOrgPolicyGovernedAssets( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicyGovernedAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicyGovernedAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPolicyGovernedAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeOrgPolicyGovernedAssets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.analyzeOrgPolicyGovernedAssets(request), expectedError); + const actualRequest = (client.innerApiCalls.analyzeOrgPolicyGovernedAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.analyzeOrgPolicyGovernedAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes analyzeOrgPolicyGovernedAssetsStream without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + ]; + client.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.analyzeOrgPolicyGovernedAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.analyzeOrgPolicyGovernedAssets, request)); + assert( + (client.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes analyzeOrgPolicyGovernedAssetsStream with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.analyzeOrgPolicyGovernedAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.analyzeOrgPolicyGovernedAssets, request)); + assert( + (client.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with analyzeOrgPolicyGovernedAssets without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + generateSampleMessage(new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset()), + ]; + client.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset[] = []; + const iterable = client.analyzeOrgPolicyGovernedAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with analyzeOrgPolicyGovernedAssets with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.analyzeOrgPolicyGovernedAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('accessLevel', () => { + const fakePath = "/rendered/path/accessLevel"; + const expectedParameters = { + access_policy: "accessPolicyValue", + access_level: "accessLevelValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessLevelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accessLevelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accessLevelPath', () => { + const result = client.accessLevelPath("accessPolicyValue", "accessLevelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accessLevelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromAccessLevelName', () => { + const result = client.matchAccessPolicyFromAccessLevelName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccessLevelFromAccessLevelName', () => { + const result = client.matchAccessLevelFromAccessLevelName(fakePath); + assert.strictEqual(result, "accessLevelValue"); + assert((client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('accessPolicy', () => { + const fakePath = "/rendered/path/accessPolicy"; + const expectedParameters = { + access_policy: "accessPolicyValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accessPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accessPolicyPath', () => { + const result = client.accessPolicyPath("accessPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accessPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromAccessPolicyName', () => { + const result = client.matchAccessPolicyFromAccessPolicyName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.accessPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderFeed', () => { + const fakePath = "/rendered/path/folderFeed"; + const expectedParameters = { + folder: "folderValue", + feed: "feedValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderFeedPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderFeedPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderFeedPath', () => { + const result = client.folderFeedPath("folderValue", "feedValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderFeedPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderFeedName', () => { + const result = client.matchFolderFromFolderFeedName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeedFromFolderFeedName', () => { + const result = client.matchFeedFromFolderFeedName(fakePath); + assert.strictEqual(result, "feedValue"); + assert((client.pathTemplates.folderFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderSavedQuery', () => { + const fakePath = "/rendered/path/folderSavedQuery"; + const expectedParameters = { + folder: "folderValue", + saved_query: "savedQueryValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderSavedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderSavedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderSavedQueryPath', () => { + const result = client.folderSavedQueryPath("folderValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderSavedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderSavedQueryName', () => { + const result = client.matchFolderFromFolderSavedQueryName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderSavedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromFolderSavedQueryName', () => { + const result = client.matchSavedQueryFromFolderSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.folderSavedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('inventory', () => { + const fakePath = "/rendered/path/inventory"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.inventoryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.inventoryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('inventoryPath', () => { + const result = client.inventoryPath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.inventoryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInventoryName', () => { + const result = client.matchProjectFromInventoryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInventoryName', () => { + const result = client.matchLocationFromInventoryName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInventoryName', () => { + const result = client.matchInstanceFromInventoryName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.inventoryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationFeed', () => { + const fakePath = "/rendered/path/organizationFeed"; + const expectedParameters = { + organization: "organizationValue", + feed: "feedValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationFeedPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationFeedPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationFeedPath', () => { + const result = client.organizationFeedPath("organizationValue", "feedValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationFeedPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationFeedName', () => { + const result = client.matchOrganizationFromOrganizationFeedName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeedFromOrganizationFeedName', () => { + const result = client.matchFeedFromOrganizationFeedName(fakePath); + assert.strictEqual(result, "feedValue"); + assert((client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationSavedQuery', () => { + const fakePath = "/rendered/path/organizationSavedQuery"; + const expectedParameters = { + organization: "organizationValue", + saved_query: "savedQueryValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationSavedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationSavedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationSavedQueryPath', () => { + const result = client.organizationSavedQueryPath("organizationValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationSavedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationSavedQueryName', () => { + const result = client.matchOrganizationFromOrganizationSavedQueryName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationSavedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromOrganizationSavedQueryName', () => { + const result = client.matchSavedQueryFromOrganizationSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.organizationSavedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath("projectValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectFeed', () => { + const fakePath = "/rendered/path/projectFeed"; + const expectedParameters = { + project: "projectValue", + feed: "feedValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectFeedPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectFeedPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectFeedPath', () => { + const result = client.projectFeedPath("projectValue", "feedValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectFeedPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectFeedName', () => { + const result = client.matchProjectFromProjectFeedName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeedFromProjectFeedName', () => { + const result = client.matchFeedFromProjectFeedName(fakePath); + assert.strictEqual(result, "feedValue"); + assert((client.pathTemplates.projectFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectSavedQuery', () => { + const fakePath = "/rendered/path/projectSavedQuery"; + const expectedParameters = { + project: "projectValue", + saved_query: "savedQueryValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectSavedQueryPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectSavedQueryPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectSavedQueryPath', () => { + const result = client.projectSavedQueryPath("projectValue", "savedQueryValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectSavedQueryPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectSavedQueryName', () => { + const result = client.matchProjectFromProjectSavedQueryName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectSavedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchSavedQueryFromProjectSavedQueryName', () => { + const result = client.matchSavedQueryFromProjectSavedQueryName(fakePath); + assert.strictEqual(result, "savedQueryValue"); + assert((client.pathTemplates.projectSavedQueryPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('servicePerimeter', () => { + const fakePath = "/rendered/path/servicePerimeter"; + const expectedParameters = { + access_policy: "accessPolicyValue", + service_perimeter: "servicePerimeterValue", + }; + const client = new assetserviceModule.v1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servicePerimeterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePerimeterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePerimeterPath', () => { + const result = client.servicePerimeterPath("accessPolicyValue", "servicePerimeterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePerimeterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromServicePerimeterName', () => { + const result = client.matchAccessPolicyFromServicePerimeterName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServicePerimeterFromServicePerimeterName', () => { + const result = client.matchServicePerimeterFromServicePerimeterName(fakePath); + assert.strictEqual(result, "servicePerimeterValue"); + assert((client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-asset/v1/tsconfig.json b/owl-bot-staging/google-cloud-asset/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1/webpack.config.js b/owl-bot-staging/google-cloud-asset/v1/webpack.config.js new file mode 100644 index 00000000000..9d42a74b844 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AssetService', + filename: './asset-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/.eslintignore b/owl-bot-staging/google-cloud-asset/v1p1beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/.eslintrc.json b/owl-bot-staging/google-cloud-asset/v1p1beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/.gitignore b/owl-bot-staging/google-cloud-asset/v1p1beta1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/.jsdoc.js b/owl-bot-staging/google-cloud-asset/v1p1beta1/.jsdoc.js new file mode 100644 index 00000000000..67e8627c41b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/asset', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/.mocharc.js b/owl-bot-staging/google-cloud-asset/v1p1beta1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/.prettierrc.js b/owl-bot-staging/google-cloud-asset/v1p1beta1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/README.md b/owl-bot-staging/google-cloud-asset/v1p1beta1/README.md new file mode 100644 index 00000000000..b35f3a5e22b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/README.md @@ -0,0 +1 @@ +Asset: Nodejs Client diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/package.json b/owl-bot-staging/google-cloud-asset/v1p1beta1/package.json new file mode 100644 index 00000000000..e478356ce8a --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/asset", + "version": "0.1.0", + "description": "Asset client for Node.js", + "repository": "googleapis/nodejs-asset", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google asset", + "asset", + "asset service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/google/cloud/asset/v1p1beta1/asset_service.proto b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/google/cloud/asset/v1p1beta1/asset_service.proto new file mode 100644 index 00000000000..05665dd1db9 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/google/cloud/asset/v1p1beta1/asset_service.proto @@ -0,0 +1,156 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.asset.v1p1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/asset/v1p1beta1/assets.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1"; +option go_package = "cloud.google.com/go/asset/apiv1p1beta1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p1beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p1beta1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Searches all the resources within a given accessible Resource Manager scope + // (project/folder/organization). This RPC gives callers especially + // administrators the ability to search all the resources within a scope, even + // if they don't have `.get` permission of all the resources. Callers should + // have `cloudasset.assets.searchAllResources` permission on the requested + // scope, otherwise the request will be rejected. + rpc SearchAllResources(SearchAllResourcesRequest) + returns (SearchAllResourcesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{scope=*/*}/resources:searchAll" + }; + option (google.api.method_signature) = "scope,query,asset_types"; + } + + // Searches all the IAM policies within a given accessible Resource Manager + // scope (project/folder/organization). This RPC gives callers especially + // administrators the ability to search all the IAM policies within a scope, + // even if they don't have `.getIamPolicy` permission of all the IAM policies. + // Callers should have `cloudasset.assets.searchAllIamPolicies` permission on + // the requested scope, otherwise the request will be rejected. + rpc SearchAllIamPolicies(SearchAllIamPoliciesRequest) + returns (SearchAllIamPoliciesResponse) { + option (google.api.http) = { + get: "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll" + }; + option (google.api.method_signature) = "scope,query"; + } +} + +// Search all resources request. +message SearchAllResourcesRequest { + // Required. The relative name of an asset. The search is limited to the + // resources within the `scope`. The allowed value must be: + // + // * Organization number (such as "organizations/123") + // * Folder number (such as "folders/1234") + // * Project number (such as "projects/12345") + // * Project ID (such as "projects/abc") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of asset types that this request searches for. If empty, + // it will search all the supported asset types. + repeated string asset_types = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Page size is capped + // at 500 even if a larger value is given. If set to zero, server will pick an + // appropriate default. Returned results may be fewer than requested. When + // this happens, there could be more results as long as `next_page_token` is + // returned. + int32 page_size = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, then retrieve the next batch of results from the + // preceding call to this method. `page_token` must be the value of + // `next_page_token` from the previous response. The values of all other + // method parameters, must be identical to those in the previous call. + string page_token = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma separated list of fields specifying the sorting order of + // the results. The default order is ascending. Add ` DESC` after the field + // name to indicate descending order. Redundant space characters are ignored. + // For example, ` location DESC , name `. + string order_by = 10 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all resources response. +message SearchAllResourcesResponse { + // A list of resource that match the search query. + repeated StandardResourceMetadata results = 1; + + // If there are more results than those appearing in this response, then + // `next_page_token` is included. To get the next set of results, call this + // method again using the value of `next_page_token` as `page_token`. + string next_page_token = 2; +} + +// Search all IAM policies request. +message SearchAllIamPoliciesRequest { + // Required. The relative name of an asset. The search is limited to the + // resources within the `scope`. The allowed value must be: + // + // * Organization number (such as "organizations/123") + // * Folder number (such as "folders/1234") + // * Project number (such as "projects/12345") + // * Project ID (such as "projects/abc") + string scope = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The query statement. Examples: + // + // * "policy:myuser@mydomain.com" + // * "policy:(myuser@mydomain.com viewer)" + string query = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The page size for search result pagination. Page size is capped + // at 500 even if a larger value is given. If set to zero, server will pick an + // appropriate default. Returned results may be fewer than requested. When + // this happens, there could be more results as long as `next_page_token` is + // returned. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If present, retrieve the next batch of results from the preceding + // call to this method. `page_token` must be the value of `next_page_token` + // from the previous response. The values of all other method parameters must + // be identical to those in the previous call. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Search all IAM policies response. +message SearchAllIamPoliciesResponse { + // A list of IAM policies that match the search query. Related information + // such as the associated resource is returned along with the policy. + repeated IamPolicySearchResult results = 1; + + // Set if there are more results than those appearing in this response; to get + // the next set of results, call this method again, using this value as the + // `page_token`. + string next_page_token = 2; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/google/cloud/asset/v1p1beta1/assets.proto b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/google/cloud/asset/v1p1beta1/assets.proto new file mode 100644 index 00000000000..042cc61c053 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/google/cloud/asset/v1p1beta1/assets.proto @@ -0,0 +1,116 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.asset.v1p1beta1; + +import "google/iam/v1/policy.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1"; +option go_package = "cloud.google.com/go/asset/apiv1p1beta1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p1beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p1beta1"; + +// The standard metadata of a cloud resource. +message StandardResourceMetadata { + // The full resource name. For example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // The type of this resource. + // For example: "compute.googleapis.com/Disk". + string asset_type = 2; + + // The project that this resource belongs to, in the form of + // `projects/{project_number}`. + string project = 3; + + // The display name of this resource. + string display_name = 4; + + // One or more paragraphs of text description of this resource. Maximum length + // could be up to 1M bytes. + string description = 5; + + // Additional searchable attributes of this resource. + // Informational only. The exact set of attributes is subject to change. + // For example: project id, DNS name etc. + repeated string additional_attributes = 10; + + // Location can be "global", regional like "us-east1", or zonal like + // "us-west1-b". + string location = 11; + + // Labels associated with this resource. See [Labelling and grouping Google + // Cloud + // resources](https://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. + map labels = 12; + + // Network tags associated with this resource. Like labels, network tags are a + // type of annotations used to group Google Cloud resources. See [Labelling + // Google Cloud + // resources](lhttps://cloud.google.com/blog/products/gcp/labelling-and-grouping-your-google-cloud-platform-resources) + // for more information. + repeated string network_tags = 13; +} + +// The result for an IAM policy search. +message IamPolicySearchResult { + // Explanation about the IAM policy search result. + message Explanation { + // The map from roles to their included permission matching the permission + // query (e.g. containing `policy.role.permissions:`). Example role string: + // "roles/compute.instanceAdmin". The roles can also be found in the + // returned `policy` bindings. Note that the map is populated only if + // requesting with a permission query. + map matched_permissions = 1; + } + + // The + // [full resource + // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // of the resource associated with this IAM policy. + string resource = 1; + + // The project that the associated Google Cloud resource belongs to, in the + // form of `projects/{project_number}`. If an IAM policy is set on a resource + // -- such as a Compute Engine instance or a Cloud Storage bucket -- the + // project field will indicate the project that contains the resource. If an + // IAM policy is set on a folder or orgnization, the project field will be + // empty. + string project = 3; + + // The IAM policy attached to the specified resource. Note that the original + // IAM policy can contain multiple bindings. This only contains the bindings + // that match the given query. For queries that don't contain a constraint on + // policies (e.g. an empty query), this contains all the bindings. + google.iam.v1.Policy policy = 4; + + // Explanation about the IAM policy search result. It contains additional + // information that explains why the search result matches the query. + Explanation explanation = 5; +} + +// IAM permissions. +message Permissions { + // A list of permissions. Example permission string: "compute.disk.get". + repeated string permissions = 1; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.d.ts b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.d.ts new file mode 100644 index 00000000000..5fde752e3e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.d.ts @@ -0,0 +1,7996 @@ +// Copyright 2024 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace asset. */ + namespace asset { + + /** Namespace v1p1beta1. */ + namespace v1p1beta1 { + + /** 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 SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + */ + public searchAllResources(request: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchAllResourcesCallback): void; + + /** + * Calls SearchAllResources. + * @param request SearchAllResourcesRequest message or plain object + * @returns Promise + */ + public searchAllResources(request: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest): Promise; + + /** + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + */ + public searchAllIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, callback: google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPoliciesCallback): void; + + /** + * Calls SearchAllIamPolicies. + * @param request SearchAllIamPoliciesRequest message or plain object + * @returns Promise + */ + public searchAllIamPolicies(request: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService|searchAllResources}. + * @param error Error, if any + * @param [response] SearchAllResourcesResponse + */ + type SearchAllResourcesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService|searchAllIamPolicies}. + * @param error Error, if any + * @param [response] SearchAllIamPoliciesResponse + */ + type SearchAllIamPoliciesCallback = (error: (Error|null), response?: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) => void; + } + + /** Properties of a SearchAllResourcesRequest. */ + interface ISearchAllResourcesRequest { + + /** SearchAllResourcesRequest scope */ + scope?: (string|null); + + /** SearchAllResourcesRequest query */ + query?: (string|null); + + /** SearchAllResourcesRequest assetTypes */ + assetTypes?: (string[]|null); + + /** SearchAllResourcesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllResourcesRequest pageToken */ + pageToken?: (string|null); + + /** SearchAllResourcesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a SearchAllResourcesRequest. */ + class SearchAllResourcesRequest implements ISearchAllResourcesRequest { + + /** + * Constructs a new SearchAllResourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest); + + /** SearchAllResourcesRequest scope. */ + public scope: string; + + /** SearchAllResourcesRequest query. */ + public query: string; + + /** SearchAllResourcesRequest assetTypes. */ + public assetTypes: string[]; + + /** SearchAllResourcesRequest pageSize. */ + public pageSize: number; + + /** SearchAllResourcesRequest pageToken. */ + public pageToken: string; + + /** SearchAllResourcesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new SearchAllResourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllResourcesRequest instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; + + /** + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * @param message SearchAllResourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; + + /** + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; + + /** + * Verifies a SearchAllResourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllResourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllResourcesRequest; + + /** + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. + * @param message SearchAllResourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllResourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllResourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllResourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllResourcesResponse. */ + interface ISearchAllResourcesResponse { + + /** SearchAllResourcesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]|null); + + /** SearchAllResourcesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAllResourcesResponse. */ + class SearchAllResourcesResponse implements ISearchAllResourcesResponse { + + /** + * Constructs a new SearchAllResourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse); + + /** SearchAllResourcesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]; + + /** SearchAllResourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAllResourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllResourcesResponse instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; + + /** + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * @param message SearchAllResourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; + + /** + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; + + /** + * Verifies a SearchAllResourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllResourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllResourcesResponse; + + /** + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. + * @param message SearchAllResourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllResourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllResourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllResourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllIamPoliciesRequest. */ + interface ISearchAllIamPoliciesRequest { + + /** SearchAllIamPoliciesRequest scope */ + scope?: (string|null); + + /** SearchAllIamPoliciesRequest query */ + query?: (string|null); + + /** SearchAllIamPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** SearchAllIamPoliciesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchAllIamPoliciesRequest. */ + class SearchAllIamPoliciesRequest implements ISearchAllIamPoliciesRequest { + + /** + * Constructs a new SearchAllIamPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest); + + /** SearchAllIamPoliciesRequest scope. */ + public scope: string; + + /** SearchAllIamPoliciesRequest query. */ + public query: string; + + /** SearchAllIamPoliciesRequest pageSize. */ + public pageSize: number; + + /** SearchAllIamPoliciesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllIamPoliciesRequest instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; + + /** + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @param message SearchAllIamPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; + + /** + * Verifies a SearchAllIamPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllIamPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest; + + /** + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllIamPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllIamPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchAllIamPoliciesResponse. */ + interface ISearchAllIamPoliciesResponse { + + /** SearchAllIamPoliciesResponse results */ + results?: (google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]|null); + + /** SearchAllIamPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAllIamPoliciesResponse. */ + class SearchAllIamPoliciesResponse implements ISearchAllIamPoliciesResponse { + + /** + * Constructs a new SearchAllIamPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse); + + /** SearchAllIamPoliciesResponse results. */ + public results: google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]; + + /** SearchAllIamPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAllIamPoliciesResponse instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @param message SearchAllIamPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAllIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAllIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; + + /** + * Verifies a SearchAllIamPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAllIamPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse; + + /** + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. + * @param message SearchAllIamPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAllIamPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAllIamPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardResourceMetadata. */ + interface IStandardResourceMetadata { + + /** StandardResourceMetadata name */ + name?: (string|null); + + /** StandardResourceMetadata assetType */ + assetType?: (string|null); + + /** StandardResourceMetadata project */ + project?: (string|null); + + /** StandardResourceMetadata displayName */ + displayName?: (string|null); + + /** StandardResourceMetadata description */ + description?: (string|null); + + /** StandardResourceMetadata additionalAttributes */ + additionalAttributes?: (string[]|null); + + /** StandardResourceMetadata location */ + location?: (string|null); + + /** StandardResourceMetadata labels */ + labels?: ({ [k: string]: string }|null); + + /** StandardResourceMetadata networkTags */ + networkTags?: (string[]|null); + } + + /** Represents a StandardResourceMetadata. */ + class StandardResourceMetadata implements IStandardResourceMetadata { + + /** + * Constructs a new StandardResourceMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata); + + /** StandardResourceMetadata name. */ + public name: string; + + /** StandardResourceMetadata assetType. */ + public assetType: string; + + /** StandardResourceMetadata project. */ + public project: string; + + /** StandardResourceMetadata displayName. */ + public displayName: string; + + /** StandardResourceMetadata description. */ + public description: string; + + /** StandardResourceMetadata additionalAttributes. */ + public additionalAttributes: string[]; + + /** StandardResourceMetadata location. */ + public location: string; + + /** StandardResourceMetadata labels. */ + public labels: { [k: string]: string }; + + /** StandardResourceMetadata networkTags. */ + public networkTags: string[]; + + /** + * Creates a new StandardResourceMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardResourceMetadata instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.IStandardResourceMetadata): google.cloud.asset.v1p1beta1.StandardResourceMetadata; + + /** + * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @param message StandardResourceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @param message StandardResourceMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IStandardResourceMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardResourceMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardResourceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.StandardResourceMetadata; + + /** + * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardResourceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.StandardResourceMetadata; + + /** + * Verifies a StandardResourceMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardResourceMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.StandardResourceMetadata; + + /** + * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. + * @param message StandardResourceMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.StandardResourceMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardResourceMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardResourceMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IamPolicySearchResult. */ + interface IIamPolicySearchResult { + + /** IamPolicySearchResult resource */ + resource?: (string|null); + + /** IamPolicySearchResult project */ + project?: (string|null); + + /** IamPolicySearchResult policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation */ + explanation?: (google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation|null); + } + + /** Represents an IamPolicySearchResult. */ + class IamPolicySearchResult implements IIamPolicySearchResult { + + /** + * Constructs a new IamPolicySearchResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult); + + /** IamPolicySearchResult resource. */ + public resource: string; + + /** IamPolicySearchResult project. */ + public project: string; + + /** IamPolicySearchResult policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** IamPolicySearchResult explanation. */ + public explanation?: (google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation|null); + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @param [properties] Properties to set + * @returns IamPolicySearchResult instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.IIamPolicySearchResult): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @param message IamPolicySearchResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IIamPolicySearchResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Verifies an IamPolicySearchResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IamPolicySearchResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.IamPolicySearchResult; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @param message IamPolicySearchResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IamPolicySearchResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace IamPolicySearchResult { + + /** Properties of an Explanation. */ + interface IExplanation { + + /** Explanation matchedPermissions */ + matchedPermissions?: ({ [k: string]: google.cloud.asset.v1p1beta1.IPermissions }|null); + } + + /** Represents an Explanation. */ + class Explanation implements IExplanation { + + /** + * Constructs a new Explanation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation); + + /** Explanation matchedPermissions. */ + public matchedPermissions: { [k: string]: google.cloud.asset.v1p1beta1.IPermissions }; + + /** + * Creates a new Explanation instance using the specified properties. + * @param [properties] Properties to set + * @returns Explanation instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation): google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @param message Explanation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation; + + /** + * Verifies an Explanation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Explanation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @param message Explanation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Explanation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Explanation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Permissions. */ + interface IPermissions { + + /** Permissions permissions */ + permissions?: (string[]|null); + } + + /** Represents a Permissions. */ + class Permissions implements IPermissions { + + /** + * Constructs a new Permissions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p1beta1.IPermissions); + + /** Permissions permissions. */ + public permissions: string[]; + + /** + * Creates a new Permissions instance using the specified properties. + * @param [properties] Properties to set + * @returns Permissions instance + */ + public static create(properties?: google.cloud.asset.v1p1beta1.IPermissions): google.cloud.asset.v1p1beta1.Permissions; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1p1beta1.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p1beta1.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.Permissions.verify|verify} messages. + * @param message Permissions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p1beta1.IPermissions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p1beta1.Permissions; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p1beta1.Permissions; + + /** + * Verifies a Permissions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Permissions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permissions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p1beta1.Permissions; + + /** + * Creates a plain object from a Permissions message. Also converts values to other types if specified. + * @param message Permissions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p1beta1.Permissions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permissions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Permissions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.js b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.js new file mode 100644 index 00000000000..e7ef5969c10 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.js @@ -0,0 +1,21953 @@ +// Copyright 2024 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_asset_protos || ($protobuf.roots._google_cloud_asset_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.asset = (function() { + + /** + * Namespace asset. + * @memberof google.cloud + * @namespace + */ + var asset = {}; + + asset.v1p1beta1 = (function() { + + /** + * Namespace v1p1beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p1beta1 = {}; + + v1p1beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents an AssetService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AssetService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AssetService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AssetService; + + /** + * Creates new AssetService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService|searchAllResources}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchAllResourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} [response] SearchAllResourcesResponse + */ + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllResourcesCallback} callback Node-style callback called with the error, if any, and SearchAllResourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllResources = function searchAllResources(request, callback) { + return this.rpcCall(searchAllResources, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse, request, callback); + }, "name", { value: "SearchAllResources" }); + + /** + * Calls SearchAllResources. + * @function searchAllResources + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} request SearchAllResourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p1beta1.AssetService|searchAllIamPolicies}. + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @typedef SearchAllIamPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} [response] SearchAllIamPoliciesResponse + */ + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @param {google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPoliciesCallback} callback Node-style callback called with the error, if any, and SearchAllIamPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.searchAllIamPolicies = function searchAllIamPolicies(request, callback) { + return this.rpcCall(searchAllIamPolicies, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest, $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse, request, callback); + }, "name", { value: "SearchAllIamPolicies" }); + + /** + * Calls SearchAllIamPolicies. + * @function searchAllIamPolicies + * @memberof google.cloud.asset.v1p1beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} request SearchAllIamPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p1beta1.SearchAllResourcesRequest = (function() { + + /** + * Properties of a SearchAllResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllResourcesRequest + * @property {string|null} [scope] SearchAllResourcesRequest scope + * @property {string|null} [query] SearchAllResourcesRequest query + * @property {Array.|null} [assetTypes] SearchAllResourcesRequest assetTypes + * @property {number|null} [pageSize] SearchAllResourcesRequest pageSize + * @property {string|null} [pageToken] SearchAllResourcesRequest pageToken + * @property {string|null} [orderBy] SearchAllResourcesRequest orderBy + */ + + /** + * Constructs a new SearchAllResourcesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllResourcesRequest. + * @implements ISearchAllResourcesRequest + * @constructor + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set + */ + function SearchAllResourcesRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * SearchAllResourcesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.scope = ""; + + /** + * SearchAllResourcesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.query = ""; + + /** + * SearchAllResourcesRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.assetTypes = $util.emptyArray; + + /** + * SearchAllResourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.pageSize = 0; + + /** + * SearchAllResourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.pageToken = ""; + + /** + * SearchAllResourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + */ + SearchAllResourcesRequest.prototype.orderBy = ""; + + /** + * Creates a new SearchAllResourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest instance + */ + SearchAllResourcesRequest.create = function create(properties) { + return new SearchAllResourcesRequest(properties); + }; + + /** + * Encodes the specified SearchAllResourcesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllResourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified SearchAllResourcesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest} message SearchAllResourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllResourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllResourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.pageSize = reader.int32(); + break; + } + case 5: { + message.pageToken = reader.string(); + break; + } + case 10: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllResourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllResourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllResourcesRequest message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllResourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a SearchAllResourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} SearchAllResourcesRequest + */ + SearchAllResourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a SearchAllResourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesRequest} message SearchAllResourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllResourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this SearchAllResourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAllResourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllResourcesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllResourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.SearchAllResourcesRequest"; + }; + + return SearchAllResourcesRequest; + })(); + + v1p1beta1.SearchAllResourcesResponse = (function() { + + /** + * Properties of a SearchAllResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllResourcesResponse + * @property {Array.|null} [results] SearchAllResourcesResponse results + * @property {string|null} [nextPageToken] SearchAllResourcesResponse nextPageToken + */ + + /** + * Constructs a new SearchAllResourcesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllResourcesResponse. + * @implements ISearchAllResourcesResponse + * @constructor + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set + */ + function SearchAllResourcesResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAllResourcesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @instance + */ + SearchAllResourcesResponse.prototype.results = $util.emptyArray; + + /** + * SearchAllResourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @instance + */ + SearchAllResourcesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAllResourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse instance + */ + SearchAllResourcesResponse.create = function create(properties) { + return new SearchAllResourcesResponse(properties); + }; + + /** + * Encodes the specified SearchAllResourcesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllResourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified SearchAllResourcesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse} message SearchAllResourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllResourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllResourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllResourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllResourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllResourcesResponse message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllResourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAllResourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} SearchAllResourcesResponse + */ + SearchAllResourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllResourcesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.fromObject(object.results[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAllResourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.SearchAllResourcesResponse} message SearchAllResourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllResourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAllResourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAllResourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllResourcesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.SearchAllResourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllResourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.SearchAllResourcesResponse"; + }; + + return SearchAllResourcesResponse; + })(); + + v1p1beta1.SearchAllIamPoliciesRequest = (function() { + + /** + * Properties of a SearchAllIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllIamPoliciesRequest + * @property {string|null} [scope] SearchAllIamPoliciesRequest scope + * @property {string|null} [query] SearchAllIamPoliciesRequest query + * @property {number|null} [pageSize] SearchAllIamPoliciesRequest pageSize + * @property {string|null} [pageToken] SearchAllIamPoliciesRequest pageToken + */ + + /** + * Constructs a new SearchAllIamPoliciesRequest. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllIamPoliciesRequest. + * @implements ISearchAllIamPoliciesRequest + * @constructor + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + */ + function SearchAllIamPoliciesRequest(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]]; + } + + /** + * SearchAllIamPoliciesRequest scope. + * @member {string} scope + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.scope = ""; + + /** + * SearchAllIamPoliciesRequest query. + * @member {string} query + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.query = ""; + + /** + * SearchAllIamPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.pageSize = 0; + + /** + * SearchAllIamPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @instance + */ + SearchAllIamPoliciesRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchAllIamPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest instance + */ + SearchAllIamPoliciesRequest.create = function create(properties) { + return new SearchAllIamPoliciesRequest(properties); + }; + + /** + * Encodes the specified SearchAllIamPoliciesRequest message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllIamPoliciesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.scope); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified SearchAllIamPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllIamPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllIamPoliciesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scope = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllIamPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllIamPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllIamPoliciesRequest message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllIamPoliciesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scope != null && message.hasOwnProperty("scope")) + if (!$util.isString(message.scope)) + return "scope: string expected"; + if (message.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAllIamPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} SearchAllIamPoliciesRequest + */ + SearchAllIamPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest(); + if (object.scope != null) + message.scope = String(object.scope); + if (object.query != null) + message.query = String(object.query); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAllIamPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest} message SearchAllIamPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllIamPoliciesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scope = ""; + object.query = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = message.scope; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this SearchAllIamPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAllIamPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllIamPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllIamPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest"; + }; + + return SearchAllIamPoliciesRequest; + })(); + + v1p1beta1.SearchAllIamPoliciesResponse = (function() { + + /** + * Properties of a SearchAllIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @interface ISearchAllIamPoliciesResponse + * @property {Array.|null} [results] SearchAllIamPoliciesResponse results + * @property {string|null} [nextPageToken] SearchAllIamPoliciesResponse nextPageToken + */ + + /** + * Constructs a new SearchAllIamPoliciesResponse. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a SearchAllIamPoliciesResponse. + * @implements ISearchAllIamPoliciesResponse + * @constructor + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + */ + function SearchAllIamPoliciesResponse(properties) { + this.results = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAllIamPoliciesResponse results. + * @member {Array.} results + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @instance + */ + SearchAllIamPoliciesResponse.prototype.results = $util.emptyArray; + + /** + * SearchAllIamPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @instance + */ + SearchAllIamPoliciesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAllIamPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse instance + */ + SearchAllIamPoliciesResponse.create = function create(properties) { + return new SearchAllIamPoliciesResponse(properties); + }; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllIamPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.results != null && message.results.length) + for (var i = 0; i < message.results.length; ++i) + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified SearchAllIamPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAllIamPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllIamPoliciesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAllIamPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAllIamPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAllIamPoliciesResponse message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAllIamPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (var i = 0; i < message.results.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify(message.results[i]); + if (error) + return "results." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAllIamPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} SearchAllIamPoliciesResponse + */ + SearchAllIamPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: array expected"); + message.results = []; + for (var i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse.results: object expected"); + message.results[i] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.fromObject(object.results[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAllIamPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse} message SearchAllIamPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAllIamPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.results = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.results && message.results.length) { + object.results = []; + for (var j = 0; j < message.results.length; ++j) + object.results[j] = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.toObject(message.results[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAllIamPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAllIamPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAllIamPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAllIamPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse"; + }; + + return SearchAllIamPoliciesResponse; + })(); + + v1p1beta1.StandardResourceMetadata = (function() { + + /** + * Properties of a StandardResourceMetadata. + * @memberof google.cloud.asset.v1p1beta1 + * @interface IStandardResourceMetadata + * @property {string|null} [name] StandardResourceMetadata name + * @property {string|null} [assetType] StandardResourceMetadata assetType + * @property {string|null} [project] StandardResourceMetadata project + * @property {string|null} [displayName] StandardResourceMetadata displayName + * @property {string|null} [description] StandardResourceMetadata description + * @property {Array.|null} [additionalAttributes] StandardResourceMetadata additionalAttributes + * @property {string|null} [location] StandardResourceMetadata location + * @property {Object.|null} [labels] StandardResourceMetadata labels + * @property {Array.|null} [networkTags] StandardResourceMetadata networkTags + */ + + /** + * Constructs a new StandardResourceMetadata. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a StandardResourceMetadata. + * @implements IStandardResourceMetadata + * @constructor + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set + */ + function StandardResourceMetadata(properties) { + this.additionalAttributes = []; + this.labels = {}; + this.networkTags = []; + 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]]; + } + + /** + * StandardResourceMetadata name. + * @member {string} name + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.name = ""; + + /** + * StandardResourceMetadata assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.assetType = ""; + + /** + * StandardResourceMetadata project. + * @member {string} project + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.project = ""; + + /** + * StandardResourceMetadata displayName. + * @member {string} displayName + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.displayName = ""; + + /** + * StandardResourceMetadata description. + * @member {string} description + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.description = ""; + + /** + * StandardResourceMetadata additionalAttributes. + * @member {Array.} additionalAttributes + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.additionalAttributes = $util.emptyArray; + + /** + * StandardResourceMetadata location. + * @member {string} location + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.location = ""; + + /** + * StandardResourceMetadata labels. + * @member {Object.} labels + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.labels = $util.emptyObject; + + /** + * StandardResourceMetadata networkTags. + * @member {Array.} networkTags + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + */ + StandardResourceMetadata.prototype.networkTags = $util.emptyArray; + + /** + * Creates a new StandardResourceMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata instance + */ + StandardResourceMetadata.create = function create(properties) { + return new StandardResourceMetadata(properties); + }; + + /** + * Encodes the specified StandardResourceMetadata message. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardResourceMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.additionalAttributes != null && message.additionalAttributes.length) + for (var i = 0; i < message.additionalAttributes.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.additionalAttributes[i]); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.location); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.networkTags != null && message.networkTags.length) + for (var i = 0; i < message.networkTags.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.networkTags[i]); + return writer; + }; + + /** + * Encodes the specified StandardResourceMetadata message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.StandardResourceMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {google.cloud.asset.v1p1beta1.IStandardResourceMetadata} message StandardResourceMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardResourceMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardResourceMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardResourceMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 10: { + if (!(message.additionalAttributes && message.additionalAttributes.length)) + message.additionalAttributes = []; + message.additionalAttributes.push(reader.string()); + break; + } + case 11: { + message.location = reader.string(); + break; + } + case 12: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 13: { + if (!(message.networkTags && message.networkTags.length)) + message.networkTags = []; + message.networkTags.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardResourceMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardResourceMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardResourceMetadata message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardResourceMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.additionalAttributes != null && message.hasOwnProperty("additionalAttributes")) { + if (!Array.isArray(message.additionalAttributes)) + return "additionalAttributes: array expected"; + for (var i = 0; i < message.additionalAttributes.length; ++i) + if (!$util.isString(message.additionalAttributes[i])) + return "additionalAttributes: string[] expected"; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.networkTags != null && message.hasOwnProperty("networkTags")) { + if (!Array.isArray(message.networkTags)) + return "networkTags: array expected"; + for (var i = 0; i < message.networkTags.length; ++i) + if (!$util.isString(message.networkTags[i])) + return "networkTags: string[] expected"; + } + return null; + }; + + /** + * Creates a StandardResourceMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.StandardResourceMetadata} StandardResourceMetadata + */ + StandardResourceMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.StandardResourceMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.project != null) + message.project = String(object.project); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.additionalAttributes) { + if (!Array.isArray(object.additionalAttributes)) + throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.additionalAttributes: array expected"); + message.additionalAttributes = []; + for (var i = 0; i < object.additionalAttributes.length; ++i) + message.additionalAttributes[i] = String(object.additionalAttributes[i]); + } + if (object.location != null) + message.location = String(object.location); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.networkTags) { + if (!Array.isArray(object.networkTags)) + throw TypeError(".google.cloud.asset.v1p1beta1.StandardResourceMetadata.networkTags: array expected"); + message.networkTags = []; + for (var i = 0; i < object.networkTags.length; ++i) + message.networkTags[i] = String(object.networkTags[i]); + } + return message; + }; + + /** + * Creates a plain object from a StandardResourceMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {google.cloud.asset.v1p1beta1.StandardResourceMetadata} message StandardResourceMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardResourceMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.additionalAttributes = []; + object.networkTags = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.project = ""; + object.displayName = ""; + object.description = ""; + object.location = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.additionalAttributes && message.additionalAttributes.length) { + object.additionalAttributes = []; + for (var j = 0; j < message.additionalAttributes.length; ++j) + object.additionalAttributes[j] = message.additionalAttributes[j]; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.networkTags && message.networkTags.length) { + object.networkTags = []; + for (var j = 0; j < message.networkTags.length; ++j) + object.networkTags[j] = message.networkTags[j]; + } + return object; + }; + + /** + * Converts this StandardResourceMetadata to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @instance + * @returns {Object.} JSON object + */ + StandardResourceMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardResourceMetadata + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.StandardResourceMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardResourceMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.StandardResourceMetadata"; + }; + + return StandardResourceMetadata; + })(); + + v1p1beta1.IamPolicySearchResult = (function() { + + /** + * Properties of an IamPolicySearchResult. + * @memberof google.cloud.asset.v1p1beta1 + * @interface IIamPolicySearchResult + * @property {string|null} [resource] IamPolicySearchResult resource + * @property {string|null} [project] IamPolicySearchResult project + * @property {google.iam.v1.IPolicy|null} [policy] IamPolicySearchResult policy + * @property {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation|null} [explanation] IamPolicySearchResult explanation + */ + + /** + * Constructs a new IamPolicySearchResult. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents an IamPolicySearchResult. + * @implements IIamPolicySearchResult + * @constructor + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set + */ + function IamPolicySearchResult(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]]; + } + + /** + * IamPolicySearchResult resource. + * @member {string} resource + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.resource = ""; + + /** + * IamPolicySearchResult project. + * @member {string} project + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.project = ""; + + /** + * IamPolicySearchResult policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.policy = null; + + /** + * IamPolicySearchResult explanation. + * @member {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation|null|undefined} explanation + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + */ + IamPolicySearchResult.prototype.explanation = null; + + /** + * Creates a new IamPolicySearchResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult instance + */ + IamPolicySearchResult.create = function create(properties) { + return new IamPolicySearchResult(properties); + }; + + /** + * Encodes the specified IamPolicySearchResult message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.project); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.explanation != null && Object.hasOwnProperty.call(message, "explanation")) + $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.encode(message.explanation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IamPolicySearchResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1p1beta1.IIamPolicySearchResult} message IamPolicySearchResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IamPolicySearchResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resource = reader.string(); + break; + } + case 3: { + message.project = reader.string(); + break; + } + case 4: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 5: { + message.explanation = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IamPolicySearchResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IamPolicySearchResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IamPolicySearchResult message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IamPolicySearchResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.explanation != null && message.hasOwnProperty("explanation")) { + var error = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify(message.explanation); + if (error) + return "explanation." + error; + } + return null; + }; + + /** + * Creates an IamPolicySearchResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult} IamPolicySearchResult + */ + IamPolicySearchResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult(); + if (object.resource != null) + message.resource = String(object.resource); + if (object.project != null) + message.project = String(object.project); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.explanation != null) { + if (typeof object.explanation !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.explanation: object expected"); + message.explanation = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.fromObject(object.explanation); + } + return message; + }; + + /** + * Creates a plain object from an IamPolicySearchResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult} message IamPolicySearchResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IamPolicySearchResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resource = ""; + object.project = ""; + object.policy = null; + object.explanation = null; + } + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.explanation != null && message.hasOwnProperty("explanation")) + object.explanation = $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.toObject(message.explanation, options); + return object; + }; + + /** + * Converts this IamPolicySearchResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @instance + * @returns {Object.} JSON object + */ + IamPolicySearchResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IamPolicySearchResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IamPolicySearchResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.IamPolicySearchResult"; + }; + + IamPolicySearchResult.Explanation = (function() { + + /** + * Properties of an Explanation. + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @interface IExplanation + * @property {Object.|null} [matchedPermissions] Explanation matchedPermissions + */ + + /** + * Constructs a new Explanation. + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult + * @classdesc Represents an Explanation. + * @implements IExplanation + * @constructor + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + */ + function Explanation(properties) { + this.matchedPermissions = {}; + 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]]; + } + + /** + * Explanation matchedPermissions. + * @member {Object.} matchedPermissions + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @instance + */ + Explanation.prototype.matchedPermissions = $util.emptyObject; + + /** + * Creates a new Explanation instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} Explanation instance + */ + Explanation.create = function create(properties) { + return new Explanation(properties); + }; + + /** + * Encodes the specified Explanation message. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.matchedPermissions != null && Object.hasOwnProperty.call(message, "matchedPermissions")) + for (var keys = Object.keys(message.matchedPermissions), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.asset.v1p1beta1.Permissions.encode(message.matchedPermissions[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Explanation message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.IExplanation} message Explanation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Explanation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Explanation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.matchedPermissions === $util.emptyObject) + message.matchedPermissions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.asset.v1p1beta1.Permissions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.matchedPermissions[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Explanation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} Explanation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Explanation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Explanation message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Explanation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.matchedPermissions != null && message.hasOwnProperty("matchedPermissions")) { + if (!$util.isObject(message.matchedPermissions)) + return "matchedPermissions: object expected"; + var key = Object.keys(message.matchedPermissions); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.asset.v1p1beta1.Permissions.verify(message.matchedPermissions[key[i]]); + if (error) + return "matchedPermissions." + error; + } + } + return null; + }; + + /** + * Creates an Explanation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} Explanation + */ + Explanation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation(); + if (object.matchedPermissions) { + if (typeof object.matchedPermissions !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions = {}; + for (var keys = Object.keys(object.matchedPermissions), i = 0; i < keys.length; ++i) { + if (typeof object.matchedPermissions[keys[i]] !== "object") + throw TypeError(".google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation.matchedPermissions: object expected"); + message.matchedPermissions[keys[i]] = $root.google.cloud.asset.v1p1beta1.Permissions.fromObject(object.matchedPermissions[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an Explanation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation} message Explanation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Explanation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.matchedPermissions = {}; + var keys2; + if (message.matchedPermissions && (keys2 = Object.keys(message.matchedPermissions)).length) { + object.matchedPermissions = {}; + for (var j = 0; j < keys2.length; ++j) + object.matchedPermissions[keys2[j]] = $root.google.cloud.asset.v1p1beta1.Permissions.toObject(message.matchedPermissions[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Explanation to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @instance + * @returns {Object.} JSON object + */ + Explanation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Explanation + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Explanation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.IamPolicySearchResult.Explanation"; + }; + + return Explanation; + })(); + + return IamPolicySearchResult; + })(); + + v1p1beta1.Permissions = (function() { + + /** + * Properties of a Permissions. + * @memberof google.cloud.asset.v1p1beta1 + * @interface IPermissions + * @property {Array.|null} [permissions] Permissions permissions + */ + + /** + * Constructs a new Permissions. + * @memberof google.cloud.asset.v1p1beta1 + * @classdesc Represents a Permissions. + * @implements IPermissions + * @constructor + * @param {google.cloud.asset.v1p1beta1.IPermissions=} [properties] Properties to set + */ + function Permissions(properties) { + 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]]; + } + + /** + * Permissions permissions. + * @member {Array.} permissions + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @instance + */ + Permissions.prototype.permissions = $util.emptyArray; + + /** + * Creates a new Permissions instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {google.cloud.asset.v1p1beta1.IPermissions=} [properties] Properties to set + * @returns {google.cloud.asset.v1p1beta1.Permissions} Permissions instance + */ + Permissions.create = function create(properties) { + return new Permissions(properties); + }; + + /** + * Encodes the specified Permissions message. Does not implicitly {@link google.cloud.asset.v1p1beta1.Permissions.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {google.cloud.asset.v1p1beta1.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.permissions[i]); + return writer; + }; + + /** + * Encodes the specified Permissions message, length delimited. Does not implicitly {@link google.cloud.asset.v1p1beta1.Permissions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {google.cloud.asset.v1p1beta1.IPermissions} message Permissions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permissions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permissions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p1beta1.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p1beta1.Permissions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permissions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p1beta1.Permissions} Permissions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permissions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permissions message. + * @function verify + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permissions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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 a Permissions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p1beta1.Permissions} Permissions + */ + Permissions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p1beta1.Permissions) + return object; + var message = new $root.google.cloud.asset.v1p1beta1.Permissions(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.cloud.asset.v1p1beta1.Permissions.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 a Permissions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {google.cloud.asset.v1p1beta1.Permissions} message Permissions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permissions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + 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 Permissions to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @instance + * @returns {Object.} JSON object + */ + Permissions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Permissions + * @function getTypeUrl + * @memberof google.cloud.asset.v1p1beta1.Permissions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Permissions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p1beta1.Permissions"; + }; + + return Permissions; + })(); + + return v1p1beta1; + })(); + + return asset; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + 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]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + 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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + 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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.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.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + 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]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + 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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + 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]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.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.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.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.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + 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]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.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.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.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.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.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.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.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.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.json b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.json new file mode 100644 index 00000000000..af9045e044c --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/protos/protos.json @@ -0,0 +1,2181 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "asset": { + "nested": { + "v1p1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1P1Beta1", + "go_package": "cloud.google.com/go/asset/apiv1p1beta1/assetpb;assetpb", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p1beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p1beta1" + }, + "nested": { + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "SearchAllResources": { + "requestType": "SearchAllResourcesRequest", + "responseType": "SearchAllResourcesResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{scope=*/*}/resources:searchAll", + "(google.api.method_signature)": "scope,query,asset_types" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{scope=*/*}/resources:searchAll" + } + }, + { + "(google.api.method_signature)": "scope,query,asset_types" + } + ] + }, + "SearchAllIamPolicies": { + "requestType": "SearchAllIamPoliciesRequest", + "responseType": "SearchAllIamPoliciesResponse", + "options": { + "(google.api.http).get": "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll", + "(google.api.method_signature)": "scope,query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p1beta1/{scope=*/*}/iamPolicies:searchAll" + } + }, + { + "(google.api.method_signature)": "scope,query" + } + ] + } + } + }, + "SearchAllResourcesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchAllResourcesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "StandardResourceMetadata", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SearchAllIamPoliciesRequest": { + "fields": { + "scope": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "SearchAllIamPoliciesResponse": { + "fields": { + "results": { + "rule": "repeated", + "type": "IamPolicySearchResult", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "StandardResourceMetadata": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "project": { + "type": "string", + "id": 3 + }, + "displayName": { + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "additionalAttributes": { + "rule": "repeated", + "type": "string", + "id": 10 + }, + "location": { + "type": "string", + "id": 11 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 12 + }, + "networkTags": { + "rule": "repeated", + "type": "string", + "id": 13 + } + } + }, + "IamPolicySearchResult": { + "fields": { + "resource": { + "type": "string", + "id": 1 + }, + "project": { + "type": "string", + "id": 3 + }, + "policy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "explanation": { + "type": "Explanation", + "id": 5 + } + }, + "nested": { + "Explanation": { + "fields": { + "matchedPermissions": { + "keyType": "string", + "type": "Permissions", + "id": 1 + } + } + } + } + }, + "Permissions": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "FieldBehaviorProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js b/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js new file mode 100644 index 00000000000..18a3b109969 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js @@ -0,0 +1,89 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope) { + // [START cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of an asset. The search is limited to the + * resources within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number (such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project ID (such as "projects/abc") + */ + // const scope = 'abc123' + /** + * Optional. The query statement. Examples: + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + */ + // const query = 'abc123' + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + */ + // const pageSize = 1234 + /** + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p1beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callSearchAllIamPolicies() { + // Construct request + const request = { + scope, + }; + + // Run request + const iterable = assetClient.searchAllIamPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchAllIamPolicies(); + // [END cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/asset_service.search_all_resources.js b/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/asset_service.search_all_resources.js new file mode 100644 index 00000000000..c42d827c8e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/asset_service.search_all_resources.js @@ -0,0 +1,99 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(scope) { + // [START cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of an asset. The search is limited to the + * resources within the `scope`. The allowed value must be: + * * Organization number (such as "organizations/123") + * * Folder number (such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project ID (such as "projects/abc") + */ + // const scope = 'abc123' + /** + * Optional. The query statement. + */ + // const query = 'abc123' + /** + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the supported asset types. + */ + // const assetTypes = ['abc','def'] + /** + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + */ + // const pageSize = 1234 + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + */ + // const pageToken = 'abc123' + /** + * Optional. A comma separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add ` DESC` after the field + * name to indicate descending order. Redundant space characters are ignored. + * For example, ` location DESC , name `. + */ + // const orderBy = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p1beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callSearchAllResources() { + // Construct request + const request = { + scope, + }; + + // Run request + const iterable = assetClient.searchAllResourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callSearchAllResources(); + // [END cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/snippet_metadata_google.cloud.asset.v1p1beta1.json b/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/snippet_metadata_google.cloud.asset.v1p1beta1.json new file mode 100644 index 00000000000..f94d51dd629 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/samples/generated/v1p1beta1/snippet_metadata_google.cloud.asset.v1p1beta1.json @@ -0,0 +1,127 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p1beta1", + "version": "v1p1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async", + "title": "AssetService searchAllResources Sample", + "origin": "API_DEFINITION", + "description": " Searches all the resources within a given accessible Resource Manager scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the resources within a scope, even if they don't have `.get` permission of all the resources. Callers should have `cloudasset.assets.searchAllResources` permission on the requested scope, otherwise the request will be rejected.", + "canonical": true, + "file": "asset_service.search_all_resources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 91, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllResources", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p1beta1.SearchAllResourcesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p1beta1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllResources", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllResources", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p1beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async", + "title": "AssetService searchAllIamPolicies Sample", + "origin": "API_DEFINITION", + "description": " Searches all the IAM policies within a given accessible Resource Manager scope (project/folder/organization). This RPC gives callers especially administrators the ability to search all the IAM policies within a scope, even if they don't have `.getIamPolicy` permission of all the IAM policies. Callers should have `cloudasset.assets.searchAllIamPolicies` permission on the requested scope, otherwise the request will be rejected.", + "canonical": true, + "file": "asset_service.search_all_iam_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPolicies", + "async": true, + "parameters": [ + { + "name": "scope", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p1beta1.SearchAllIamPoliciesResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p1beta1.AssetServiceClient" + }, + "method": { + "shortName": "SearchAllIamPolicies", + "fullName": "google.cloud.asset.v1p1beta1.AssetService.SearchAllIamPolicies", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p1beta1.AssetService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/src/index.ts b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/index.ts new file mode 100644 index 00000000000..a5d552832cb --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 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 v1p1beta1 from './v1p1beta1'; +const AssetServiceClient = v1p1beta1.AssetServiceClient; +type AssetServiceClient = v1p1beta1.AssetServiceClient; +export {v1p1beta1, AssetServiceClient}; +export default {v1p1beta1, AssetServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_client.ts b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_client.ts new file mode 100644 index 00000000000..d966c234e45 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_client.ts @@ -0,0 +1,818 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1p1beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './asset_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p1beta1 + */ +export class AssetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + assetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AssetServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AssetServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'cloudasset.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && '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}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + searchAllResources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'results'), + searchAllIamPolicies: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'results') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.asset.v1p1beta1.AssetService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.v1p1beta1.AssetService. + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.asset.v1p1beta1.AssetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.asset.v1p1beta1.AssetService, + this._opts, this._providedCustomServicePath) 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 = + ['searchAllResources', 'searchAllIamPolicies']; + for (const methodName of assetServiceStubMethods) { + const callPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.assetServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Searches all the resources within a given accessible Resource Manager scope + * (project/folder/organization). This RPC gives callers especially + * administrators the ability to search all the resources within a scope, even + * if they don't have `.get` permission of all the resources. Callers should + * have `cloudasset.assets.searchAllResources` permission on the requested + * scope, otherwise the request will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the + * resources within the `scope`. The allowed value must be: + * + * * Organization number (such as "organizations/123") + * * Folder number (such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project ID (such as "projects/abc") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add ` DESC` after the field + * name to indicate descending order. Redundant space characters are ignored. + * For example, ` location DESC , name `. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata|StandardResourceMetadata}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchAllResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAllResources( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest|null, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + ]>; + searchAllResources( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse|null|undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata>): void; + searchAllResources( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse|null|undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata>): void; + searchAllResources( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse|null|undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse|null|undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata>): + Promise<[ + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest|null, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchAllResources(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the + * resources within the `scope`. The allowed value must be: + * + * * Organization number (such as "organizations/123") + * * Folder number (such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project ID (such as "projects/abc") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add ` DESC` after the field + * name to indicate descending order. Redundant space characters are ignored. + * For example, ` location DESC , name `. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata|StandardResourceMetadata} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchAllResourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAllResourcesStream( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['searchAllResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllResources.createStream( + this.innerApiCalls.searchAllResources as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchAllResources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the + * resources within the `scope`. The allowed value must be: + * + * * Organization number (such as "organizations/123") + * * Folder number (such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project ID (such as "projects/abc") + * @param {string} [request.query] + * Optional. The query statement. + * @param {string[]} [request.assetTypes] + * Optional. A list of asset types that this request searches for. If empty, + * it will search all the supported asset types. + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. `page_token` must be the value of + * `next_page_token` from the previous response. The values of all other + * method parameters, must be identical to those in the previous call. + * @param {string} [request.orderBy] + * Optional. A comma separated list of fields specifying the sorting order of + * the results. The default order is ascending. Add ` DESC` after the field + * name to indicate descending order. Redundant space characters are ignored. + * For example, ` location DESC , name `. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata|StandardResourceMetadata}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/asset_service.search_all_resources.js + * region_tag:cloudasset_v1p1beta1_generated_AssetService_SearchAllResources_async + */ + searchAllResourcesAsync( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['searchAllResources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllResources.asyncIterate( + this.innerApiCalls['searchAllResources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Searches all the IAM policies within a given accessible Resource Manager + * scope (project/folder/organization). This RPC gives callers especially + * administrators the ability to search all the IAM policies within a scope, + * even if they don't have `.getIamPolicy` permission of all the IAM policies. + * Callers should have `cloudasset.assets.searchAllIamPolicies` permission on + * the requested scope, otherwise the request will be rejected. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the + * resources within the `scope`. The allowed value must be: + * + * * Organization number (such as "organizations/123") + * * Folder number (such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project ID (such as "projects/abc") + * @param {string} [request.query] + * Optional. The query statement. Examples: + * + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult|IamPolicySearchResult}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `searchAllIamPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAllIamPolicies( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest|null, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + ]>; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult>): void; + searchAllIamPolicies( + request: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult>): void; + searchAllIamPolicies( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse|null|undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult>): + Promise<[ + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest|null, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + this.initialize(); + return this.innerApiCalls.searchAllIamPolicies(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the + * resources within the `scope`. The allowed value must be: + * + * * Organization number (such as "organizations/123") + * * Folder number (such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project ID (such as "projects/abc") + * @param {string} [request.query] + * Optional. The query statement. Examples: + * + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult|IamPolicySearchResult} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `searchAllIamPoliciesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + searchAllIamPoliciesStream( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['searchAllIamPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllIamPolicies.createStream( + this.innerApiCalls.searchAllIamPolicies as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `searchAllIamPolicies`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.scope + * Required. The relative name of an asset. The search is limited to the + * resources within the `scope`. The allowed value must be: + * + * * Organization number (such as "organizations/123") + * * Folder number (such as "folders/1234") + * * Project number (such as "projects/12345") + * * Project ID (such as "projects/abc") + * @param {string} [request.query] + * Optional. The query statement. Examples: + * + * * "policy:myuser@mydomain.com" + * * "policy:(myuser@mydomain.com viewer)" + * @param {number} [request.pageSize] + * Optional. The page size for search result pagination. Page size is capped + * at 500 even if a larger value is given. If set to zero, server will pick an + * appropriate default. Returned results may be fewer than requested. When + * this happens, there could be more results as long as `next_page_token` is + * returned. + * @param {string} [request.pageToken] + * Optional. If present, retrieve the next batch of results from the preceding + * call to this method. `page_token` must be the value of `next_page_token` + * from the previous response. The values of all other method parameters must + * be identical to those in the previous call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult|IamPolicySearchResult}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js + * region_tag:cloudasset_v1p1beta1_generated_AssetService_SearchAllIamPolicies_async + */ + searchAllIamPoliciesAsync( + request?: protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'scope': request.scope ?? '', + }); + const defaultCallSettings = this._defaults['searchAllIamPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.searchAllIamPolicies.asyncIterate( + this.innerApiCalls['searchAllIamPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_client_config.json b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_client_config.json new file mode 100644 index 00000000000..fe7cd34beeb --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.asset.v1p1beta1.AssetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "SearchAllResources": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SearchAllIamPolicies": { + "timeout_millis": 15000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_proto_list.json b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..4eba2431088 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/asset_service_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/asset/v1p1beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p1beta1/assets.proto" +] diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/gapic_metadata.json new file mode 100644 index 00000000000..4376c4982d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/gapic_metadata.json @@ -0,0 +1,51 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1p1beta1", + "libraryPackage": "@google-cloud/asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "SearchAllResources": { + "methods": [ + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" + ] + }, + "SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "SearchAllResources": { + "methods": [ + "searchAllResources", + "searchAllResourcesStream", + "searchAllResourcesAsync" + ] + }, + "SearchAllIamPolicies": { + "methods": [ + "searchAllIamPolicies", + "searchAllIamPoliciesStream", + "searchAllIamPoliciesAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/index.ts b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/index.ts new file mode 100644 index 00000000000..f87a8e44978 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/src/v1p1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 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/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..997ccf2219e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const asset = require('@google-cloud/asset'); + +function main() { + const assetServiceClient = new asset.AssetServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..1794fc57ef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AssetServiceClient} from '@google-cloud/asset'; + +// check that the client class type name can be used +function doStuffWithAssetServiceClient(client: AssetServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const assetServiceClient = new AssetServiceClient(); + doStuffWithAssetServiceClient(assetServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/install.ts b/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/test/gapic_asset_service_v1p1beta1.ts b/owl-bot-staging/google-cloud-asset/v1p1beta1/test/gapic_asset_service_v1p1beta1.ts new file mode 100644 index 00000000000..d17a323e5d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/test/gapic_asset_service_v1p1beta1.ts @@ -0,0 +1,751 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as assetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p1beta1.AssetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = assetserviceModule.v1p1beta1.AssetServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = assetserviceModule.v1p1beta1.AssetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new assetserviceModule.v1p1beta1.AssetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = assetserviceModule.v1p1beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p1beta1.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 for the initialized client', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('searchAllResources', () => { + it('invokes searchAllResources without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + ]; + client.innerApiCalls.searchAllResources = stubSimpleCall(expectedResponse); + const [response] = await client.searchAllResources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllResources without error using callback', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + ]; + client.innerApiCalls.searchAllResources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAllResources( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllResources with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllResources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchAllResources(request), expectedError); + const actualRequest = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllResources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllResourcesStream without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + ]; + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchAllResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchAllResources, request)); + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchAllResourcesStream with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAllResourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchAllResources, request)); + assert( + (client.descriptors.page.searchAllResources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllResources without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata()), + ]; + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = []; + const iterable = client.searchAllResourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllResources with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllResourcesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAllResourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchAllResources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('searchAllIamPolicies', () => { + it('invokes searchAllIamPolicies without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + ]; + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall(expectedResponse); + const [response] = await client.searchAllIamPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllIamPolicies without error using callback', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + ]; + client.innerApiCalls.searchAllIamPolicies = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.searchAllIamPolicies( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllIamPolicies with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.searchAllIamPolicies = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.searchAllIamPolicies(request), expectedError); + const actualRequest = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.searchAllIamPolicies as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes searchAllIamPoliciesStream without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + ]; + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.searchAllIamPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchAllIamPolicies, request)); + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes searchAllIamPoliciesStream with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.searchAllIamPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.searchAllIamPolicies, request)); + assert( + (client.descriptors.page.searchAllIamPolicies.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllIamPolicies without error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + generateSampleMessage(new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult()), + ]; + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = []; + const iterable = client.searchAllIamPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with searchAllIamPolicies with error', async () => { + const client = new assetserviceModule.v1p1beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p1beta1.SearchAllIamPoliciesRequest', ['scope']); + request.scope = defaultValue1; + const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.searchAllIamPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.searchAllIamPolicies.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/tsconfig.json b/owl-bot-staging/google-cloud-asset/v1p1beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1p1beta1/webpack.config.js b/owl-bot-staging/google-cloud-asset/v1p1beta1/webpack.config.js new file mode 100644 index 00000000000..9d42a74b844 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p1beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AssetService', + filename: './asset-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/.eslintignore b/owl-bot-staging/google-cloud-asset/v1p2beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/.eslintrc.json b/owl-bot-staging/google-cloud-asset/v1p2beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/.gitignore b/owl-bot-staging/google-cloud-asset/v1p2beta1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/.jsdoc.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/.jsdoc.js new file mode 100644 index 00000000000..67e8627c41b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/asset', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/.mocharc.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/.prettierrc.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/README.md b/owl-bot-staging/google-cloud-asset/v1p2beta1/README.md new file mode 100644 index 00000000000..b35f3a5e22b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/README.md @@ -0,0 +1 @@ +Asset: Nodejs Client diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/package.json b/owl-bot-staging/google-cloud-asset/v1p2beta1/package.json new file mode 100644 index 00000000000..e478356ce8a --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/asset", + "version": "0.1.0", + "description": "Asset client for Node.js", + "repository": "googleapis/nodejs-asset", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google asset", + "asset", + "asset service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/asset/v1p2beta1/asset_service.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/asset/v1p2beta1/asset_service.proto new file mode 100644 index 00000000000..663029cf1a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/asset/v1p2beta1/asset_service.proto @@ -0,0 +1,276 @@ +// Copyright 2024 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.v1p2beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/asset/v1p2beta1/assets.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P2Beta1"; +option go_package = "cloud.google.com/go/asset/apiv1p2beta1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p2beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p2beta1"; + +// 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"; + + // Creates a feed in a parent project/folder/organization to listen to its + // asset updates. + rpc CreateFeed(CreateFeedRequest) returns (Feed) { + option (google.api.http) = { + post: "/v1p2beta1/{parent=*/*}/feeds" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details about an asset feed. + rpc GetFeed(GetFeedRequest) returns (Feed) { + option (google.api.http) = { + get: "/v1p2beta1/{name=*/*/feeds/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all asset feeds in a parent project/folder/organization. + rpc ListFeeds(ListFeedsRequest) returns (ListFeedsResponse) { + option (google.api.http) = { + get: "/v1p2beta1/{parent=*/*}/feeds" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates an asset feed configuration. + rpc UpdateFeed(UpdateFeedRequest) returns (Feed) { + option (google.api.http) = { + patch: "/v1p2beta1/{feed.name=*/*/feeds/*}" + body: "*" + }; + option (google.api.method_signature) = "feed"; + } + + // Deletes an asset feed. + rpc DeleteFeed(DeleteFeedRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1p2beta1/{name=*/*/feeds/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// The export asset response. This message is returned by the +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] +// method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field. +message ExportAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Output configuration indicating where the results were output to. + OutputConfig output_config = 2; +} + +// Batch get assets history response. +message BatchGetAssetsHistoryResponse { + // A list of assets with valid time windows. + repeated TemporalAsset assets = 1; +} + +// Create asset feed request. +message CreateFeedRequest { + // Required. The name of the project/folder/organization where this feed + // should be created in. It can only be an organization number (such as + // "organizations/123"), a folder number (such as "folders/123"), a project ID + // (such as "projects/my-project-id"), or a project number (such as + // "projects/12345"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. This is the client-assigned asset feed identifier and it needs to + // be unique under a specific parent project/folder/organization. + string feed_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The feed details. The field `name` must be empty and it will be + // generated in the format of: projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + Feed feed = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Get asset feed request. +message GetFeedRequest { + // Required. The name of the Feed and it must be in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + ]; +} + +// List asset feeds request. +message ListFeedsRequest { + // Required. The parent project/folder/organization whose feeds are to be + // listed. It can only be using project/folder/organization number (such as + // "folders/12345")", or a project ID (such as "projects/my-project-id"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; +} + +message ListFeedsResponse { + // A list of feeds. + repeated Feed feeds = 1; +} + +// Update asset feed request. +message UpdateFeedRequest { + // Required. The new values of feed details. It must match an existing feed + // and the field `name` must be in the format of: + // projects/project_number/feeds/feed_id or + // folders/folder_number/feeds/feed_id or + // organizations/organization_number/feeds/feed_id. + Feed feed = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only updates the `feed` fields indicated by this mask. + // The field mask must not be empty, and it must not contain fields that + // are immutable or only set by the server. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +message DeleteFeedRequest { + // Required. The name of the feed and it must be in the format of: + // projects/project_number/feeds/feed_id + // folders/folder_number/feeds/feed_id + // organizations/organization_number/feeds/feed_id + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "cloudasset.googleapis.com/Feed" } + ]; +} + +// Output configuration for export assets destination. +message OutputConfig { + // Asset export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + } +} + +// A Cloud Storage location. +message GcsDestination { + // Required. + oneof object_uri { + // The URI of the Cloud Storage object. It's the same URI that is used by + // gsutil. For example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1; + } +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; +} + +// A Pub/Sub destination. +message PubsubDestination { + // The name of the Pub/Sub topic to publish to. + // For example: `projects/PROJECT_ID/topics/TOPIC_ID`. + string topic = 1; +} + +// Output configuration for asset feed destination. +message FeedOutputConfig { + // Asset feed destination. + oneof destination { + // Destination on Pub/Sub. + PubsubDestination pubsub_destination = 1; + } +} + +// An asset feed used to export asset updates to a destinations. +// An asset feed filter controls what updates are exported. +// The asset feed must be created within a project, organization, or +// folder. Supported destinations are: +// Cloud Pub/Sub topics. +message Feed { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Feed" + pattern: "projects/{project}/feeds/{feed}" + pattern: "folders/{folder}/feeds/{feed}" + pattern: "organizations/{organization}/feeds/{feed}" + history: ORIGINALLY_SINGLE_PATTERN + }; + + // Required. The format will be + // projects/{project_number}/feeds/{client-assigned_feed_identifier} or + // folders/{folder_number}/feeds/{client-assigned_feed_identifier} or + // organizations/{organization_number}/feeds/{client-assigned_feed_identifier} + // + // The client-assigned feed identifier must be unique within the parent + // project/folder/organization. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // A list of the full names of the assets to receive updates. You must specify + // either or both of asset_names and asset_types. Only asset updates matching + // specified asset_names or asset_types are exported to the feed. For + // example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`. + // See [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more info. + repeated string asset_names = 2; + + // A list of types of the assets to receive updates. You must specify either + // or both of asset_names and asset_types. Only asset updates matching + // specified asset_names or asset_types are exported to the feed. + // For example: + // "compute.googleapis.com/Disk" See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name and + // type will be returned. + ContentType content_type = 4; + + // Required. Feed output configuration defining where the asset updates are + // published to. + FeedOutputConfig feed_output_config = 5 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/asset/v1p2beta1/assets.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/asset/v1p2beta1/assets.proto new file mode 100644 index 00000000000..6d971d17528 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/asset/v1p2beta1/assets.proto @@ -0,0 +1,179 @@ +// Copyright 2024 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.v1p2beta1; + +import "google/api/resource.proto"; +import "google/cloud/orgpolicy/v1/orgpolicy.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P2Beta1"; +option go_package = "cloud.google.com/go/asset/apiv1p2beta1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p2beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p2beta1"; + +// An asset in Google Cloud and its temporal metadata, including the time window +// when it was observed and its status during that window. +message TemporalAsset { + // The time window when the asset data and state was observed. + TimeWindow window = 1; + + // Whether the asset has been deleted or not. + bool deleted = 2; + + // An asset in Google Cloud. + Asset asset = 3; +} + +// A time window specified by its `start_time` and `end_time`. +message TimeWindow { + // Start time of the time window (exclusive). + google.protobuf.Timestamp start_time = 1; + + // End time of the time window (inclusive). If not specified, the current + // timestamp is used instead. + google.protobuf.Timestamp end_time = 2; +} + +// An asset in Google Cloud. An asset can be any resource in the Google Cloud +// [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // A representation of the resource. + Resource resource = 3; + + // A representation of the IAM policy set on a Google Cloud resource. + // There can be a maximum of one IAM policy set on any given resource. + // In addition, IAM policies inherit their granted access scope from any + // policies set on parent resources in the resource hierarchy. Therefore, the + // effectively policy is the union of both the policy set on this resource + // and each policy set on all of the resource's ancestry resource levels in + // the hierarchy. See + // [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + // for more information. + google.iam.v1.Policy iam_policy = 4; + + // The ancestry path of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. If the asset + // is a project, folder, or organization, the ancestry path starts from the + // asset itself. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 6; + + // A representation of an [access + // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + oneof access_context_policy { + // Please also refer to the [access policy user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + + // Please also refer to the [access level user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). + google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + + // Please also refer to the [service perimeter user + // guide](https://cloud.google.com/vpc-service-controls/docs/overview). + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; + } + + // A representation of an [organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + // There can be more than one organization policy with different constraints + // set on a given resource. + repeated google.cloud.orgpolicy.v1.Policy org_policy = 10; +} + +// A representation of a Google Cloud resource. +message Resource { + // The API version. Example: `v1` + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // Example: + // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. Example: + // `Project` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP `GET` request using this + // URL returns the resource itself. Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + // + // This value is unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + // + // For Google Cloud assets, this value is the parent resource defined in the + // [IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // Example: + // `//cloudresourcemanager.googleapis.com/projects/my_project_123` + // + // For third-party assets, this field may be set differently. + string parent = 5; + + // The content of the resource, in which some sensitive fields are removed + // and may not be present. + google.protobuf.Struct data = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto new file mode 100644 index 00000000000..10fe86a216e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto @@ -0,0 +1,313 @@ +// Copyright 2024 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.orgpolicy.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OrgPolicy.V1"; +option go_package = "cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyProto"; +option java_package = "com.google.cloud.orgpolicy.v1"; +option php_namespace = "Google\\Cloud\\OrgPolicy\\V1"; +option ruby_package = "Google::Cloud::OrgPolicy::V1"; + +// Defines a Cloud Organization `Policy` which is used to specify `Constraints` +// for configurations of Cloud Platform resources. +message Policy { + // Used in `policy_type` to specify how `list_policy` behaves at this + // resource. + // + // `ListPolicy` can define specific values and subtrees of Cloud Resource + // Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that + // are allowed or denied by setting the `allowed_values` and `denied_values` + // fields. This is achieved by using the `under:` and optional `is:` prefixes. + // The `under:` prefix is used to denote resource subtree values. + // The `is:` prefix is used to denote specific values, and is required only + // if the value contains a ":". Values prefixed with "is:" are treated the + // same as values with no prefix. + // Ancestry subtrees must be in one of the following formats: + // - "projects/", e.g. "projects/tokyo-rain-123" + // - "folders/", e.g. "folders/1234" + // - "organizations/", e.g. "organizations/1234" + // The `supports_under` field of the associated `Constraint` defines whether + // ancestry prefixes can be used. You can set `allowed_values` and + // `denied_values` in the same `Policy` if `all_values` is + // `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all + // values. If `all_values` is set to either `ALLOW` or `DENY`, + // `allowed_values` and `denied_values` must be unset. + message ListPolicy { + // This enum can be used to set `Policies` that apply to all possible + // configuration values rather than specific values in `allowed_values` or + // `denied_values`. + // + // Settting this to `ALLOW` will mean this `Policy` allows all values. + // Similarly, setting it to `DENY` will mean no values are allowed. If + // set to either `ALLOW` or `DENY, `allowed_values` and `denied_values` + // must be unset. Setting this to `ALL_VALUES_UNSPECIFIED` allows for + // setting `allowed_values` and `denied_values`. + enum AllValues { + // Indicates that allowed_values or denied_values must be set. + ALL_VALUES_UNSPECIFIED = 0; + + // A policy with this set allows all values. + ALLOW = 1; + + // A policy with this set denies all values. + DENY = 2; + } + + // List of values allowed at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string allowed_values = 1; + + // List of values denied at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string denied_values = 2; + + // The policy all_values state. + AllValues all_values = 3; + + // Optional. The Google Cloud Console will try to default to a configuration + // that matches the value specified in this `Policy`. If `suggested_value` + // is not set, it will inherit the value specified higher in the hierarchy, + // unless `inherit_from_parent` is `false`. + string suggested_value = 4; + + // Determines the inheritance behavior for this `Policy`. + // + // By default, a `ListPolicy` set at a resource supercedes any `Policy` set + // anywhere up the resource hierarchy. However, if `inherit_from_parent` is + // set to `true`, then the values from the effective `Policy` of the parent + // resource are inherited, meaning the values set in this `Policy` are + // added to the values inherited up the hierarchy. + // + // Setting `Policy` hierarchies that inherit both allowed values and denied + // values isn't recommended in most circumstances to keep the configuration + // simple and understandable. However, it is possible to set a `Policy` with + // `allowed_values` set that inherits a `Policy` with `denied_values` set. + // In this case, the values that are allowed must be in `allowed_values` and + // not present in `denied_values`. + // + // For example, suppose you have a `Constraint` + // `constraints/serviceuser.services`, which has a `constraint_type` of + // `list_constraint`, and with `constraint_default` set to `ALLOW`. + // Suppose that at the Organization level, a `Policy` is applied that + // restricts the allowed API activations to {`E1`, `E2`}. Then, if a + // `Policy` is applied to a project below the Organization that has + // `inherit_from_parent` set to `false` and field all_values set to DENY, + // then an attempt to activate any API will be denied. + // + // The following examples demonstrate different possible layerings for + // `projects/bar` parented by `organizations/foo`: + // + // Example 1 (no inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has `inherit_from_parent` `false` and values: + // {allowed_values: "E3" allowed_values: "E4"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E3`, and `E4`. + // + // Example 2 (inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {value: "E3" value: "E4" inherit_from_parent: true} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. + // + // Example 3 (inheriting both allowed and denied values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {denied_values: "E1"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The value accepted at `projects/bar` is `E2`. + // + // Example 4 (RestoreDefault): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {RestoreDefault: {}} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 5 (no policy inherits parent policy): + // `organizations/foo` has no `Policy` set. + // `projects/bar` has no `Policy` set. + // The accepted values at both levels are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 6 (ListConstraint allowing all): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: ALLOW} + // The accepted values at `organizations/foo` are `E1`, E2`. + // Any value is accepted at `projects/bar`. + // + // Example 7 (ListConstraint allowing none): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: DENY} + // The accepted values at `organizations/foo` are `E1`, E2`. + // No value is accepted at `projects/bar`. + // + // Example 10 (allowed and denied subtrees of Resource Manager hierarchy): + // Given the following resource hierarchy + // O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "under:organizations/O1"} + // `projects/bar` has a `Policy` with: + // {allowed_values: "under:projects/P3"} + // {denied_values: "under:folders/F2"} + // The accepted values at `organizations/foo` are `organizations/O1`, + // `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`, + // `projects/P3`. + // The accepted values at `projects/bar` are `organizations/O1`, + // `folders/F1`, `projects/P1`. + bool inherit_from_parent = 5; + } + + // Used in `policy_type` to specify how `boolean_policy` will behave at this + // resource. + message BooleanPolicy { + // If `true`, then the `Policy` is enforced. If `false`, then any + // configuration is acceptable. + // + // Suppose you have a `Constraint` + // `constraints/compute.disableSerialPortAccess` with `constraint_default` + // set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following + // behavior: + // - If the `Policy` at this resource has enforced set to `false`, serial + // port connection attempts will be allowed. + // - If the `Policy` at this resource has enforced set to `true`, serial + // port connection attempts will be refused. + // - If the `Policy` at this resource is `RestoreDefault`, serial port + // connection attempts will be allowed. + // - If no `Policy` is set at this resource or anywhere higher in the + // resource hierarchy, serial port connection attempts will be allowed. + // - If no `Policy` is set at this resource, but one exists higher in the + // resource hierarchy, the behavior is as if the`Policy` were set at + // this resource. + // + // The following examples demonstrate the different possible layerings: + // + // Example 1 (nearest `Constraint` wins): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has no `Policy` set. + // The constraint at `projects/bar` and `organizations/foo` will not be + // enforced. + // + // Example 2 (enforcement gets replaced): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has a `Policy` with: + // {enforced: true} + // The constraint at `organizations/foo` is not enforced. + // The constraint at `projects/bar` is enforced. + // + // Example 3 (RestoreDefault): + // `organizations/foo` has a `Policy` with: + // {enforced: true} + // `projects/bar` has a `Policy` with: + // {RestoreDefault: {}} + // The constraint at `organizations/foo` is enforced. + // The constraint at `projects/bar` is not enforced, because + // `constraint_default` for the `Constraint` is `ALLOW`. + bool enforced = 1; + } + + // Ignores policies set above this resource and restores the + // `constraint_default` enforcement behavior of the specific `Constraint` at + // this resource. + // + // Suppose that `constraint_default` is set to `ALLOW` for the + // `Constraint` `constraints/serviceuser.services`. Suppose that organization + // foo.com sets a `Policy` at their Organization resource node that restricts + // the allowed service activations to deny all service activations. They + // could then set a `Policy` with the `policy_type` `restore_default` on + // several experimental projects, restoring the `constraint_default` + // enforcement of the `Constraint` for only those projects, allowing those + // projects to have all services activated. + message RestoreDefault { + + } + + // Version of the `Policy`. Default version is 0; + int32 version = 1; + + // The name of the `Constraint` the `Policy` is configuring, for example, + // `constraints/serviceuser.services`. + // + // Immutable after creation. + string constraint = 2; + + // An opaque tag indicating the current version of the `Policy`, used for + // concurrency control. + // + // When the `Policy` is returned from either a `GetPolicy` or a + // `ListOrgPolicy` request, this `etag` indicates the version of the current + // `Policy` to use when executing a read-modify-write loop. + // + // When the `Policy` is returned from a `GetEffectivePolicy` request, the + // `etag` will be unset. + // + // When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value + // that was returned from a `GetOrgPolicy` request as part of a + // read-modify-write loop for concurrency control. Not setting the `etag`in a + // `SetOrgPolicy` request will result in an unconditional write of the + // `Policy`. + bytes etag = 3; + + // The time stamp the `Policy` was previously updated. This is set by the + // server, not specified by the caller, and represents the last time a call to + // `SetOrgPolicy` was made for that `Policy`. Any value set by the client will + // be ignored. + google.protobuf.Timestamp update_time = 4; + + // The field to populate is based on the `constraint_type` value in the + // `Constraint`. + // `list_constraint` => `list_policy` + // `boolean_constraint` => `boolean_policy` + // + // A `restore_default` message may be used with any `Constraint` type. + // + // Providing a *_policy that is incompatible with the `constraint_type` will + // result in an `invalid_argument` error. + // + // Attempting to set a `Policy` with a `policy_type` not set will result in an + // `invalid_argument` error. + oneof policy_type { + // List of values either allowed or disallowed. + ListPolicy list_policy = 5; + + // For boolean `Constraints`, whether to enforce the `Constraint` or not. + BooleanPolicy boolean_policy = 6; + + // Restores the default behavior of the constraint; independent of + // `Constraint` type. + RestoreDefault restore_default = 7; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/iam/v1/policy.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/iam/v1/policy.proto new file mode 100644 index 00000000000..9bff39ac73f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/iam/v1/policy.proto @@ -0,0 +1,410 @@ +// Copyright 2024 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.iam.v1; + +import "google/type/expr.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Iam.V1"; +option go_package = "cloud.google.com/go/iam/apiv1/iampb;iampb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.iam.v1"; +option php_namespace = "Google\\Cloud\\Iam\\V1"; + +// An Identity and Access Management (IAM) policy, which specifies access +// controls for Google Cloud resources. +// +// +// A `Policy` is a collection of `bindings`. A `binding` binds one or more +// `members`, or principals, to a single `role`. Principals can be user +// accounts, service accounts, Google groups, and domains (such as G Suite). A +// `role` is a named list of permissions; each `role` can be an IAM predefined +// role or a user-created custom role. +// +// For some types of Google Cloud resources, a `binding` can also specify a +// `condition`, which is a logical expression that allows access to a resource +// only if the expression evaluates to `true`. A condition can add constraints +// based on attributes of the request, the resource, or both. To learn which +// resources support conditions in their IAM policies, see the +// [IAM +// documentation](https://cloud.google.com/iam/help/conditions/resource-policies). +// +// **JSON example:** +// +// ``` +// { +// "bindings": [ +// { +// "role": "roles/resourcemanager.organizationAdmin", +// "members": [ +// "user:mike@example.com", +// "group:admins@example.com", +// "domain:google.com", +// "serviceAccount:my-project-id@appspot.gserviceaccount.com" +// ] +// }, +// { +// "role": "roles/resourcemanager.organizationViewer", +// "members": [ +// "user:eve@example.com" +// ], +// "condition": { +// "title": "expirable access", +// "description": "Does not grant access after Sep 2020", +// "expression": "request.time < +// timestamp('2020-10-01T00:00:00.000Z')", +// } +// } +// ], +// "etag": "BwWWja0YfJA=", +// "version": 3 +// } +// ``` +// +// **YAML example:** +// +// ``` +// bindings: +// - members: +// - user:mike@example.com +// - group:admins@example.com +// - domain:google.com +// - serviceAccount:my-project-id@appspot.gserviceaccount.com +// role: roles/resourcemanager.organizationAdmin +// - members: +// - user:eve@example.com +// role: roles/resourcemanager.organizationViewer +// condition: +// title: expirable access +// description: Does not grant access after Sep 2020 +// expression: request.time < timestamp('2020-10-01T00:00:00.000Z') +// etag: BwWWja0YfJA= +// version: 3 +// ``` +// +// For a description of IAM and its features, see the +// [IAM documentation](https://cloud.google.com/iam/docs/). +message Policy { + // Specifies the format of the policy. + // + // Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + // are rejected. + // + // Any operation that affects conditional role bindings must specify version + // `3`. This requirement applies to the following operations: + // + // * Getting a policy that includes a conditional role binding + // * Adding a conditional role binding to a policy + // * Changing a conditional role binding in a policy + // * Removing any role binding, with or without a condition, from a policy + // that includes conditions + // + // **Important:** If you use IAM Conditions, you must include the `etag` field + // whenever you call `setIamPolicy`. If you omit this field, then IAM allows + // you to overwrite a version `3` policy with a version `1` policy, and all of + // the conditions in the version `3` policy are lost. + // + // If a policy does not include any conditions, operations on that policy may + // specify any valid version or leave the field unset. + // + // To learn which resources support conditions in their IAM policies, see the + // [IAM + // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + int32 version = 1; + + // Associates a list of `members`, or principals, with a `role`. Optionally, + // may specify a `condition` that determines how and when the `bindings` are + // applied. Each of the `bindings` must contain at least one principal. + // + // The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + // of these principals can be Google groups. Each occurrence of a principal + // counts towards these limits. For example, if the `bindings` grant 50 + // different roles to `user:alice@example.com`, and not to any other + // principal, then you can add another 1,450 principals to the `bindings` in + // the `Policy`. + repeated Binding bindings = 4; + + // Specifies cloud audit logging configuration for this policy. + repeated AuditConfig audit_configs = 6; + + // `etag` is used for optimistic concurrency control as a way to help + // prevent simultaneous updates of a policy from overwriting each other. + // It is strongly suggested that systems make use of the `etag` in the + // read-modify-write cycle to perform policy updates in order to avoid race + // conditions: An `etag` is returned in the response to `getIamPolicy`, and + // systems are expected to put that etag in the request to `setIamPolicy` to + // ensure that their change will be applied to the same version of the policy. + // + // **Important:** If you use IAM Conditions, you must include the `etag` field + // whenever you call `setIamPolicy`. If you omit this field, then IAM allows + // you to overwrite a version `3` policy with a version `1` policy, and all of + // the conditions in the version `3` policy are lost. + bytes etag = 3; +} + +// Associates `members`, or principals, with a `role`. +message Binding { + // Role that is assigned to the list of `members`, or principals. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + string role = 1; + + // Specifies the principals requesting access for a Google Cloud resource. + // `members` can have the following values: + // + // * `allUsers`: A special identifier that represents anyone who is + // on the internet; with or without a Google account. + // + // * `allAuthenticatedUsers`: A special identifier that represents anyone + // who is authenticated with a Google account or a service account. + // + // * `user:{emailid}`: An email address that represents a specific Google + // account. For example, `alice@example.com` . + // + // + // * `serviceAccount:{emailid}`: An email address that represents a service + // account. For example, `my-other-app@appspot.gserviceaccount.com`. + // + // * `group:{emailid}`: An email address that represents a Google group. + // For example, `admins@example.com`. + // + // * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + // identifier) representing a user that has been recently deleted. For + // example, `alice@example.com?uid=123456789012345678901`. If the user is + // recovered, this value reverts to `user:{emailid}` and the recovered user + // retains the role in the binding. + // + // * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + // unique identifier) representing a service account that has been recently + // deleted. For example, + // `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + // If the service account is undeleted, this value reverts to + // `serviceAccount:{emailid}` and the undeleted service account retains the + // role in the binding. + // + // * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + // identifier) representing a Google group that has been recently + // deleted. For example, `admins@example.com?uid=123456789012345678901`. If + // the group is recovered, this value reverts to `group:{emailid}` and the + // recovered group retains the role in the binding. + // + // + // * `domain:{domain}`: The G Suite domain (primary) that represents all the + // users of that domain. For example, `google.com` or `example.com`. + // + // + repeated string members = 2; + + // The condition that is associated with this binding. + // + // If the condition evaluates to `true`, then this binding applies to the + // current request. + // + // If the condition evaluates to `false`, then this binding does not apply to + // the current request. However, a different role binding might grant the same + // role to one or more of the principals in this binding. + // + // To learn which resources support conditions in their IAM policies, see the + // [IAM + // documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + google.type.Expr condition = 3; +} + +// Specifies the audit configuration for a service. +// The configuration determines which permission types are logged, and what +// identities, if any, are exempted from logging. +// An AuditConfig must have one or more AuditLogConfigs. +// +// If there are AuditConfigs for both `allServices` and a specific service, +// the union of the two AuditConfigs is used for that service: the log_types +// specified in each AuditConfig are enabled, and the exempted_members in each +// AuditLogConfig are exempted. +// +// Example Policy with multiple AuditConfigs: +// +// { +// "audit_configs": [ +// { +// "service": "allServices", +// "audit_log_configs": [ +// { +// "log_type": "DATA_READ", +// "exempted_members": [ +// "user:jose@example.com" +// ] +// }, +// { +// "log_type": "DATA_WRITE" +// }, +// { +// "log_type": "ADMIN_READ" +// } +// ] +// }, +// { +// "service": "sampleservice.googleapis.com", +// "audit_log_configs": [ +// { +// "log_type": "DATA_READ" +// }, +// { +// "log_type": "DATA_WRITE", +// "exempted_members": [ +// "user:aliya@example.com" +// ] +// } +// ] +// } +// ] +// } +// +// For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ +// logging. It also exempts `jose@example.com` from DATA_READ logging, and +// `aliya@example.com` from DATA_WRITE logging. +message AuditConfig { + // Specifies a service that will be enabled for audit logging. + // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + // `allServices` is a special value that covers all services. + string service = 1; + + // The configuration for logging of each type of permission. + repeated AuditLogConfig audit_log_configs = 3; +} + +// Provides the configuration for logging a type of permissions. +// Example: +// +// { +// "audit_log_configs": [ +// { +// "log_type": "DATA_READ", +// "exempted_members": [ +// "user:jose@example.com" +// ] +// }, +// { +// "log_type": "DATA_WRITE" +// } +// ] +// } +// +// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +// jose@example.com from DATA_READ logging. +message AuditLogConfig { + // The list of valid permission types for which logging can be configured. + // Admin writes are always logged, and are not configurable. + enum LogType { + // Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0; + + // Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1; + + // Data writes. Example: CloudSQL Users create + DATA_WRITE = 2; + + // Data reads. Example: CloudSQL Users list + DATA_READ = 3; + } + + // The log type that this config enables. + LogType log_type = 1; + + // Specifies the identities that do not cause logging for this type of + // permission. + // Follows the same format of + // [Binding.members][google.iam.v1.Binding.members]. + repeated string exempted_members = 2; +} + +// The difference delta between two policies. +message PolicyDelta { + // The delta for Bindings between two policies. + repeated BindingDelta binding_deltas = 1; + + // The delta for AuditConfigs between two policies. + repeated AuditConfigDelta audit_config_deltas = 2; +} + +// One delta entry for Binding. Each individual change (only one member in each +// entry) to a binding will be a separate entry. +message BindingDelta { + // The type of action performed on a Binding in a policy. + enum Action { + // Unspecified. + ACTION_UNSPECIFIED = 0; + + // Addition of a Binding. + ADD = 1; + + // Removal of a Binding. + REMOVE = 2; + } + + // The action that was performed on a Binding. + // Required + Action action = 1; + + // Role that is assigned to `members`. + // For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + // Required + string role = 2; + + // A single identity requesting access for a Google Cloud resource. + // Follows the same format of Binding.members. + // Required + string member = 3; + + // The condition that is associated with this binding. + google.type.Expr condition = 4; +} + +// One delta entry for AuditConfig. Each individual change (only one +// exempted_member in each entry) to a AuditConfig will be a separate entry. +message AuditConfigDelta { + // The type of action performed on an audit configuration in a policy. + enum Action { + // Unspecified. + ACTION_UNSPECIFIED = 0; + + // Addition of an audit configuration. + ADD = 1; + + // Removal of an audit configuration. + REMOVE = 2; + } + + // The action that was performed on an audit configuration in a policy. + // Required + Action action = 1; + + // Specifies a service that was configured for Cloud Audit Logging. + // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + // `allServices` is a special value that covers all services. + // Required + string service = 2; + + // A single identity that is exempted from "data access" audit + // logging for the `service` specified above. + // Follows the same format of Binding.members. + string exempted_member = 3; + + // Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + // enabled, and cannot be configured. + // Required + string log_type = 4; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto new file mode 100644 index 00000000000..c442283b3ca --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto @@ -0,0 +1,83 @@ +// Copyright 2024 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.identity.accesscontextmanager.type; + +option csharp_namespace = "Google.Identity.AccessContextManager.Type"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type"; +option java_package = "com.google.identity.accesscontextmanager.type"; +option java_multiple_files = true; +option java_outer_classname = "TypeProto"; +option php_namespace = "Google\\Identity\\AccessContextManager\\Type"; +option ruby_package = "Google::Identity::AccessContextManager::Type"; + +// The encryption state of the device. +enum DeviceEncryptionStatus { + // The encryption status of the device is not specified or not known. + ENCRYPTION_UNSPECIFIED = 0; + + // The device does not support encryption. + ENCRYPTION_UNSUPPORTED = 1; + + // The device supports encryption, but is currently unencrypted. + UNENCRYPTED = 2; + + // The device is encrypted. + ENCRYPTED = 3; +} + +// The operating system type of the device. +// Next id: 7 +enum OsType { + // The operating system of the device is not specified or not known. + OS_UNSPECIFIED = 0; + + // A desktop Mac operating system. + DESKTOP_MAC = 1; + + // A desktop Windows operating system. + DESKTOP_WINDOWS = 2; + + // A desktop Linux operating system. + DESKTOP_LINUX = 3; + + // A desktop ChromeOS operating system. + DESKTOP_CHROME_OS = 6; + + // An Android operating system. + ANDROID = 4; + + // An iOS operating system. + IOS = 5; +} + +// The degree to which the device is managed by the Cloud organization. +enum DeviceManagementLevel { + // The device's management level is not specified or not known. + MANAGEMENT_UNSPECIFIED = 0; + + // The device is not managed. + NONE = 1; + + // Basic management is enabled, which is generally limited to monitoring and + // wiping the corporate account. + BASIC = 2; + + // Complete device management. This includes more thorough monitoring and the + // ability to directly manage the device (such as remote wiping). This can be + // enabled through the Android Enterprise Platform. + COMPLETE = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto new file mode 100644 index 00000000000..7563f09a025 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto @@ -0,0 +1,986 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessContextManagerProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// API for setting [access levels] +// [google.identity.accesscontextmanager.v1.AccessLevel] and [service +// perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] +// for Google Cloud projects. Each organization has one [access policy] +// [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the +// [access levels] [google.identity.accesscontextmanager.v1.AccessLevel] +// and [service perimeters] +// [google.identity.accesscontextmanager.v1.ServicePerimeter]. This +// [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is +// applicable to all resources in the organization. +// AccessPolicies +service AccessContextManager { + option (google.api.default_host) = "accesscontextmanager.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all [access policies] + // [google.identity.accesscontextmanager.v1.AccessPolicy] in an + // organization. + rpc ListAccessPolicies(ListAccessPoliciesRequest) returns (ListAccessPoliciesResponse) { + option (google.api.http) = { + get: "/v1/accessPolicies" + }; + } + + // Returns an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] based on the name. + rpc GetAccessPolicy(GetAccessPolicyRequest) returns (AccessPolicy) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an access policy. This method fails if the organization already has + // an access policy. The long-running operation has a successful status + // after the access policy propagates to long-lasting storage. + // Syntactic and basic semantic errors are returned in `metadata` as a + // BadRequest proto. + rpc CreateAccessPolicy(AccessPolicy) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/accessPolicies" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "AccessPolicy" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. The + // long-running operation from this RPC has a successful status after the + // changes to the [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] propagate + // to long-lasting storage. + rpc UpdateAccessPolicy(UpdateAccessPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{policy.name=accessPolicies/*}" + body: "policy" + }; + option (google.api.method_signature) = "policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AccessPolicy" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] based on the + // resource name. The long-running operation has a successful status after the + // [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] + // is removed from long-lasting storage. + rpc DeleteAccessPolicy(DeleteAccessPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] for an access + // policy. + rpc ListAccessLevels(ListAccessLevelsRequest) returns (ListAccessLevelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accessPolicies/*}/accessLevels" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + // name. + rpc GetAccessLevel(GetAccessLevelRequest) returns (AccessLevel) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*/accessLevels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + // operation from this RPC has a successful status after the [access + // level] [google.identity.accesscontextmanager.v1.AccessLevel] + // propagates to long-lasting storage. If [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contain + // errors, an error response is returned for the first error encountered. + rpc CreateAccessLevel(CreateAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/accessLevels" + body: "access_level" + }; + option (google.api.method_signature) = "parent,access_level"; + option (google.longrunning.operation_info) = { + response_type: "AccessLevel" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + // operation from this RPC has a successful status after the changes to + // the [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] propagate + // to long-lasting storage. If [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contain + // errors, an error response is returned for the first error encountered. + rpc UpdateAccessLevel(UpdateAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{access_level.name=accessPolicies/*/accessLevels/*}" + body: "access_level" + }; + option (google.api.method_signature) = "access_level,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AccessLevel" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + // name. The long-running operation from this RPC has a successful status + // after the [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] has been removed + // from long-lasting storage. + rpc DeleteAccessLevel(DeleteAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*/accessLevels/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Replaces all existing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] in an [access + // policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with + // the [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] provided. This + // is done atomically. The long-running operation from this RPC has a + // successful status after all replacements propagate to long-lasting + // storage. If the replacement contains errors, an error response is returned + // for the first error encountered. Upon error, the replacement is cancelled, + // and existing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] are not + // affected. The Operation.response field contains + // ReplaceAccessLevelsResponse. Removing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contained in existing + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] result in an + // error. + rpc ReplaceAccessLevels(ReplaceAccessLevelsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/accessLevels:replaceAll" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ReplaceAccessLevelsResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] for an + // access policy. + rpc ListServicePerimeters(ListServicePerimetersRequest) returns (ListServicePerimetersResponse) { + option (google.api.http) = { + get: "/v1/{parent=accessPolicies/*}/servicePerimeters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + // resource name. + rpc GetServicePerimeter(GetServicePerimeterRequest) returns (ServicePerimeter) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*/servicePerimeters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. The + // long-running operation from this RPC has a successful status after the + // [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] + // propagates to long-lasting storage. If a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + // errors, an error response is returned for the first error encountered. + rpc CreateServicePerimeter(CreateServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters" + body: "service_perimeter" + }; + option (google.api.method_signature) = "parent,service_perimeter"; + option (google.longrunning.operation_info) = { + response_type: "ServicePerimeter" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. The + // long-running operation from this RPC has a successful status after the + // [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] + // propagates to long-lasting storage. If a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + // errors, an error response is returned for the first error encountered. + rpc UpdateServicePerimeter(UpdateServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{service_perimeter.name=accessPolicies/*/servicePerimeters/*}" + body: "service_perimeter" + }; + option (google.api.method_signature) = "service_perimeter,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ServicePerimeter" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + // resource name. The long-running operation from this RPC has a successful + // status after the [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] is removed from + // long-lasting storage. + rpc DeleteServicePerimeter(DeleteServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*/servicePerimeters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Replace all existing [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in an [access + // policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with the + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. This + // is done atomically. The long-running operation from this RPC has a + // successful status after all replacements propagate to long-lasting storage. + // Replacements containing errors result in an error response for the first + // error encountered. Upon an error, replacement are cancelled and existing + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] are not + // affected. The Operation.response field contains + // ReplaceServicePerimetersResponse. + rpc ReplaceServicePerimeters(ReplaceServicePerimetersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters:replaceAll" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ReplaceServicePerimetersResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Commits the dry-run specification for all the [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in an + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + // A commit operation on a service perimeter involves copying its `spec` field + // to the `status` field of the service perimeter. Only [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] with + // `use_explicit_dry_run_spec` field set to true are affected by a commit + // operation. The long-running operation from this RPC has a successful + // status after the dry-run specifications for all the [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] have been + // committed. If a commit fails, it causes the long-running operation to + // return an error response and the entire commit operation is cancelled. + // When successful, the Operation.response field contains + // CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are + // cleared after a successful commit operation. + rpc CommitServicePerimeters(CommitServicePerimetersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters:commit" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "CommitServicePerimetersResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [GcpUserAccessBindings] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] for a + // Google Cloud organization. + rpc ListGcpUserAccessBindings(ListGcpUserAccessBindingsRequest) returns (ListGcpUserAccessBindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/gcpUserAccessBindings" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] with + // the given name. + rpc GetGcpUserAccessBinding(GetGcpUserAccessBindingRequest) returns (GcpUserAccessBinding) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/gcpUserAccessBindings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. If the + // client specifies a [name] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.name], + // the server ignores it. Fails if a resource already exists with the same + // [group_key] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.group_key]. + // Completion of this long-running operation does not necessarily signify that + // the new binding is deployed onto all affected users, which may take more + // time. + rpc CreateGcpUserAccessBinding(CreateGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/gcpUserAccessBindings" + body: "gcp_user_access_binding" + }; + option (google.api.method_signature) = "parent,gcp_user_access_binding"; + option (google.longrunning.operation_info) = { + response_type: "GcpUserAccessBinding" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Updates a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. + // Completion of this long-running operation does not necessarily signify that + // the changed binding is deployed onto all affected users, which may take + // more time. + rpc UpdateGcpUserAccessBinding(UpdateGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{gcp_user_access_binding.name=organizations/*/gcpUserAccessBindings/*}" + body: "gcp_user_access_binding" + }; + option (google.api.method_signature) = "gcp_user_access_binding,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GcpUserAccessBinding" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Deletes a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. + // Completion of this long-running operation does not necessarily signify that + // the binding deletion is deployed onto all affected users, which may take + // more time. + rpc DeleteGcpUserAccessBinding(DeleteGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/gcpUserAccessBindings/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Sets the IAM policy for the specified Access Context Manager + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + // This method replaces the existing IAM policy on the access policy. The IAM + // policy controls the set of users who can perform specific operations on the + // Access Context Manager [access + // policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:setIamPolicy" + body: "*" + }; + } + + // Gets the IAM policy for the specified Access Context Manager + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:getIamPolicy" + body: "*" + }; + } + + // Returns the IAM permissions that the caller has on the specified Access + // Context Manager resource. The resource can be an + // [AccessPolicy][google.identity.accesscontextmanager.v1.AccessPolicy], + // [AccessLevel][google.identity.accesscontextmanager.v1.AccessLevel], or + // [ServicePerimeter][google.identity.accesscontextmanager.v1.ServicePerimeter + // ]. This method does not support other resources. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=accessPolicies/*/accessLevels/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1/{resource=accessPolicies/*/servicePerimeters/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// A request to list all `AccessPolicies` for a container. +message ListAccessPoliciesRequest { + // Required. Resource name for the container to list AccessPolicy instances + // from. + // + // Format: + // `organizations/{org_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Number of AccessPolicy instances to include in the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of AccessPolicy instances. Defaults to + // the first page of results. + string page_token = 3; +} + +// A response to `ListAccessPoliciesRequest`. +message ListAccessPoliciesResponse { + // List of the AccessPolicy instances. + repeated AccessPolicy access_policies = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `AccessPolicy`. +message GetAccessPolicyRequest { + // Required. Resource name for the access policy to get. + // + // Format `accessPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + } + ]; +} + +// A request to update an `AccessPolicy`. +message UpdateAccessPolicyRequest { + // Required. The updated AccessPolicy. + AccessPolicy policy = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an `AccessPolicy`. +message DeleteAccessPolicyRequest { + // Required. Resource name for the access policy to delete. + // + // Format `accessPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + } + ]; +} + +// A request to list all `AccessLevels` in an `AccessPolicy`. +message ListAccessLevelsRequest { + // Required. Resource name for the access policy to list [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] from. + // + // Format: + // `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Number of [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] to include in + // the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + // Defaults to the first page of results. + string page_token = 3; + + // Whether to return `BasicLevels` in the Cloud Common Expression language, as + // `CustomLevels`, rather than as `BasicLevels`. Defaults to returning + // `AccessLevels` in the format they were defined. + LevelFormat access_level_format = 4; +} + +// A response to `ListAccessLevelsRequest`. +message ListAccessLevelsResponse { + // List of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + repeated AccessLevel access_levels = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `AccessLevel`. +message GetAccessLevelRequest { + // Required. Resource name for the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: + // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Whether to return `BasicLevels` in the Cloud Common Expression + // Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where + // [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel] + // are returned as `BasicLevels` or `CustomLevels` based on how they were + // created. If set to CEL, all [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] are returned as + // `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent + // `CustomLevels`. + LevelFormat access_level_format = 2; +} + +// A request to create an `AccessLevel`. +message CreateAccessLevelRequest { + // Required. Resource name for the access policy which owns this [Access + // Level] [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Required. The [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] to create. + // Syntactic correctness of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] is a + // precondition for creation. + AccessLevel access_level = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update an `AccessLevel`. +message UpdateAccessLevelRequest { + // Required. The updated [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. Syntactic + // correctness of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] is a + // precondition for creation. + AccessLevel access_level = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an `AccessLevel`. +message DeleteAccessLevelRequest { + // Required. Resource name for the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: + // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; +} + +// A request to replace all existing Access Levels in an Access Policy with +// the Access Levels provided. This is done atomically. +message ReplaceAccessLevelsRequest { + // Required. Resource name for the access policy which owns these + // [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Required. The desired [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] that should + // replace all existing [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] in the + // [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated AccessLevel access_levels = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // replace operation is to be performed on. If, at the time of replace, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the replace operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 4; +} + +// A response to ReplaceAccessLevelsRequest. This will be put inside of +// Operation.response field. +message ReplaceAccessLevelsResponse { + // List of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + repeated AccessLevel access_levels = 1; +} + +// A request to list all `ServicePerimeters` in an `AccessPolicy`. +message ListServicePerimetersRequest { + // Required. Resource name for the access policy to list [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] from. + // + // Format: + // `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Number of [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to include + // in the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + // Defaults to the first page of results. + string page_token = 3; +} + +// A response to `ListServicePerimetersRequest`. +message ListServicePerimetersResponse { + // List of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + repeated ServicePerimeter service_perimeters = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `ServicePerimeter`. +message GetServicePerimeterRequest { + // Required. Resource name for the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: + // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; +} + +// A request to create a `ServicePerimeter`. +message CreateServicePerimeterRequest { + // Required. Resource name for the access policy which owns this [Service + // Perimeter] [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Required. The [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to create. + // Syntactic correctness of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] is a + // precondition for creation. + ServicePerimeter service_perimeter = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update a `ServicePerimeter`. +message UpdateServicePerimeterRequest { + // Required. The updated `ServicePerimeter`. Syntactic correctness of the + // `ServicePerimeter` is a precondition for creation. + ServicePerimeter service_perimeter = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete a `ServicePerimeter`. +message DeleteServicePerimeterRequest { + // Required. Resource name for the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: + // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; +} + +// A request to replace all existing Service Perimeters in an Access Policy +// with the Service Perimeters provided. This is done atomically. +message ReplaceServicePerimetersRequest { + // Required. Resource name for the access policy which owns these + // [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Required. The desired [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] that should + // replace all existing [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in the + // [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated ServicePerimeter service_perimeters = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // replace operation is to be performed on. If, at the time of replace, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the replace operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 3; +} + +// A response to ReplaceServicePerimetersRequest. This will be put inside of +// Operation.response field. +message ReplaceServicePerimetersResponse { + // List of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + repeated ServicePerimeter service_perimeters = 1; +} + +// A request to commit dry-run specs in all [Service Perimeters] +// [google.identity.accesscontextmanager.v1.ServicePerimeter] belonging to +// an [Access Policy][google.identity.accesscontextmanager.v1.AccessPolicy]. +message CommitServicePerimetersRequest { + // Required. Resource name for the parent [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] which owns all + // [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in scope for + // the commit operation. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // commit operation is to be performed on. If, at the time of commit, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the commit operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 2; +} + +// A response to CommitServicePerimetersRequest. This will be put inside of +// Operation.response field. +message CommitServicePerimetersResponse { + // List of all the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances in + // the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated ServicePerimeter service_perimeters = 1; +} + +// The format used in an `AccessLevel`. +enum LevelFormat { + // The format was not specified. + LEVEL_FORMAT_UNSPECIFIED = 0; + + // Uses the format the resource was defined in. BasicLevels are returned as + // BasicLevels, CustomLevels are returned as CustomLevels. + AS_DEFINED = 1; + + // Use Cloud Common Expression Language when returning the resource. Both + // BasicLevels and CustomLevels are returned as CustomLevels. + CEL = 2; +} + +// Request of [ListGcpUserAccessBindings] +// [google.identity.accesscontextmanager.v1.AccessContextManager.ListGcpUserAccessBindings]. +message ListGcpUserAccessBindingsRequest { + // Required. Example: "organizations/256" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Optional. Maximum number of items to return. The server may return fewer items. + // If left blank, the server may return any number of items. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If left blank, returns the first page. To enumerate all items, use the + // [next_page_token] + // [google.identity.accesscontextmanager.v1.ListGcpUserAccessBindingsResponse.next_page_token] + // from your previous list operation. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of [ListGcpUserAccessBindings] +// [google.identity.accesscontextmanager.v1.AccessContextManager.ListGcpUserAccessBindings]. +message ListGcpUserAccessBindingsResponse { + // [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + repeated GcpUserAccessBinding gcp_user_access_bindings = 1; + + // Token to get the next page of items. If blank, there are no more items. + string next_page_token = 2; +} + +// Request of [GetGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.GetGcpUserAccessBinding]. +message GetGcpUserAccessBindingRequest { + // Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + } + ]; +} + +// Request of [CreateGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.CreateGcpUserAccessBinding]. +message CreateGcpUserAccessBindingRequest { + // Required. Example: "organizations/256" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + GcpUserAccessBinding gcp_user_access_binding = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request of [UpdateGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.UpdateGcpUserAccessBinding]. +message UpdateGcpUserAccessBindingRequest { + // Required. [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + GcpUserAccessBinding gcp_user_access_binding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only the fields specified in this mask are updated. Because name and + // group_key cannot be changed, update_mask is required and must always be: + // + // update_mask { + // paths: "access_levels" + // } + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request of [DeleteGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.DeleteGcpUserAccessBinding]. +message DeleteGcpUserAccessBindingRequest { + // Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + } + ]; +} + +// Currently, a completed operation means nothing. In the future, this metadata +// and a completed operation may indicate that the binding has taken effect and +// is affecting access decisions for all users. +message GcpUserAccessBindingOperationMetadata { + +} + +// Metadata of Access Context Manager's Long Running Operations. +message AccessContextManagerOperationMetadata { + +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto new file mode 100644 index 00000000000..204b74a8290 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto @@ -0,0 +1,192 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/identity/accesscontextmanager/type/device_resources.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessLevelProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// An `AccessLevel` is a label that can be applied to requests to Google Cloud +// services, along with a list of requirements necessary for the label to be +// applied. +message AccessLevel { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + pattern: "accessPolicies/{access_policy}/accessLevels/{access_level}" + }; + + // Required. Resource name for the Access Level. The `short_name` component + // must begin with a letter and only include alphanumeric and '_'. Format: + // `accessPolicies/{access_policy}/accessLevels/{access_level}`. The maximum + // length of the `access_level` component is 50 characters. + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `AccessLevel` and its use. Does not affect behavior. + string description = 3; + + // Required. Describes the necessary conditions for the level to apply. + oneof level { + // A `BasicLevel` composed of `Conditions`. + BasicLevel basic = 4; + + // A `CustomLevel` written in the Common Expression Language. + CustomLevel custom = 5; + } + + // Output only. Time the `AccessLevel` was created in UTC. + google.protobuf.Timestamp create_time = 6; + + // Output only. Time the `AccessLevel` was updated in UTC. + google.protobuf.Timestamp update_time = 7; +} + +// `BasicLevel` is an `AccessLevel` using a set of recommended features. +message BasicLevel { + // Options for how the `conditions` list should be combined to determine if + // this `AccessLevel` is applied. Default is AND. + enum ConditionCombiningFunction { + // All `Conditions` must be true for the `BasicLevel` to be true. + AND = 0; + + // If at least one `Condition` is true, then the `BasicLevel` is true. + OR = 1; + } + + // Required. A list of requirements for the `AccessLevel` to be granted. + repeated Condition conditions = 1; + + // How the `conditions` list should be combined to determine if a request is + // granted this `AccessLevel`. If AND is used, each `Condition` in + // `conditions` must be satisfied for the `AccessLevel` to be applied. If OR + // is used, at least one `Condition` in `conditions` must be satisfied for the + // `AccessLevel` to be applied. Default behavior is AND. + ConditionCombiningFunction combining_function = 2; +} + +// A condition necessary for an `AccessLevel` to be granted. The Condition is an +// AND over its fields. So a Condition is true if: 1) the request IP is from one +// of the listed subnetworks AND 2) the originating device complies with the +// listed device policy AND 3) all listed access levels are granted AND 4) the +// request was sent at a time allowed by the DateTimeRestriction. +message Condition { + // CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for + // a CIDR IP address block, the specified IP address portion must be properly + // truncated (i.e. all the host bits must be zero) or the input is considered + // malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is + // not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas + // "2001:db8::1/32" is not. The originating IP of a request must be in one of + // the listed subnets in order for this Condition to be true. If empty, all IP + // addresses are allowed. + repeated string ip_subnetworks = 1; + + // Device specific restrictions, all restrictions must hold for the + // Condition to be true. If not specified, all devices are allowed. + DevicePolicy device_policy = 2; + + // A list of other access levels defined in the same `Policy`, referenced by + // resource name. Referencing an `AccessLevel` which does not exist is an + // error. All access levels listed must be granted for the Condition + // to be true. Example: + // "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` + repeated string required_access_levels = 3; + + // Whether to negate the Condition. If true, the Condition becomes a NAND over + // its non-empty fields, each field must be false for the Condition overall to + // be satisfied. Defaults to false. + bool negate = 5; + + // The request must be made by one of the provided user or service + // accounts. Groups are not supported. + // Syntax: + // `user:{emailid}` + // `serviceAccount:{emailid}` + // If not specified, a request may come from any user. + repeated string members = 6; + + // The request must originate from one of the provided countries/regions. + // Must be valid ISO 3166-1 alpha-2 codes. + repeated string regions = 7; +} + +// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +// to represent the necessary conditions for the level to apply to a request. +// See CEL spec at: https://github.com/google/cel-spec +message CustomLevel { + // Required. A Cloud CEL expression evaluating to a boolean. + google.type.Expr expr = 1; +} + +// `DevicePolicy` specifies device specific restrictions necessary to acquire a +// given access level. A `DevicePolicy` specifies requirements for requests from +// devices to be granted access levels, it does not do any enforcement on the +// device. `DevicePolicy` acts as an AND over all specified fields, and each +// repeated field is an OR over its elements. Any unset fields are ignored. For +// example, if the proto is { os_type : DESKTOP_WINDOWS, os_type : +// DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be +// true for requests originating from encrypted Linux desktops and encrypted +// Windows desktops. +message DevicePolicy { + // Whether or not screenlock is required for the DevicePolicy to be true. + // Defaults to `false`. + bool require_screenlock = 1; + + // Allowed encryptions statuses, an empty list allows all statuses. + repeated google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + + // Allowed OS versions, an empty list allows all types and all versions. + repeated OsConstraint os_constraints = 3; + + // Allowed device management levels, an empty list allows all management + // levels. + repeated google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + + // Whether the device needs to be approved by the customer admin. + bool require_admin_approval = 7; + + // Whether the device needs to be corp owned. + bool require_corp_owned = 8; +} + +// A restriction on the OS type and version of devices making requests. +message OsConstraint { + // Required. The allowed OS type. + google.identity.accesscontextmanager.type.OsType os_type = 1; + + // The minimum allowed OS version. If not set, any version of this OS + // satisfies the constraint. Format: `"major.minor.patch"`. + // Examples: `"10.5.301"`, `"9.2.1"`. + string minimum_version = 2; + + // Only allows requests from devices with a verified Chrome OS. + // Verifications includes requirements that the device is enterprise-managed, + // conformant to domain policies, and the caller has permission to call + // the API targeted by the request. + bool require_verified_chrome_os = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto new file mode 100644 index 00000000000..65b574d9375 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto @@ -0,0 +1,81 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// `AccessPolicy` is a container for `AccessLevels` (which define the necessary +// attributes to use Google Cloud services) and `ServicePerimeters` (which +// define regions of services able to freely pass data within a perimeter). An +// access policy is globally visible within an organization, and the +// restrictions it specifies apply to all projects within an organization. +message AccessPolicy { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + pattern: "accessPolicies/{access_policy}" + }; + + // Output only. Resource name of the `AccessPolicy`. Format: + // `accessPolicies/{access_policy}` + string name = 1; + + // Required. The parent of this `AccessPolicy` in the Cloud Resource + // Hierarchy. Currently immutable once created. Format: + // `organizations/{organization_id}` + string parent = 2; + + // Required. Human readable title. Does not affect behavior. + string title = 3; + + // The scopes of a policy define which resources an ACM policy can restrict, + // and where ACM resources can be referenced. + // For example, a policy with scopes=["folders/123"] has the following + // behavior: + // - vpcsc perimeters can only restrict projects within folders/123 + // - access levels can only be referenced by resources within folders/123. + // If empty, there are no limitations on which resources can be restricted by + // an ACM policy, and there are no limitations on where ACM resources can be + // referenced. + // Only one policy can include a given scope (attempting to create a second + // policy which includes "folders/123" will result in an error). + // Currently, scopes cannot be modified after a policy is created. + // Currently, policies can only have a single scope. + // Format: list of `folders/{folder_number}` or `projects/{project_number}` + repeated string scopes = 7; + + // Output only. Time the `AccessPolicy` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `AccessPolicy` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Output only. An opaque identifier for the current version of the + // `AccessPolicy`. This will always be a strongly validated etag, meaning that + // two Access Polices will be identical if and only if their etags are + // identical. Clients should not expect this to be in any specific format. + string etag = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto new file mode 100644 index 00000000000..ced18e9f9ed --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto @@ -0,0 +1,68 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "GcpUserAccessBindingProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// Restricts access to Cloud Console and Google Cloud APIs for a set of users +// using Context-Aware Access. +message GcpUserAccessBinding { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + pattern: "organizations/{organization}/gcpUserAccessBindings/{gcp_user_access_binding}" + }; + + // Immutable. Assigned by the server during creation. The last segment has an arbitrary + // length and has only URI unreserved characters (as defined by + // [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)). + // Should not be specified by the client during creation. + // Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. Google Group id whose members are subject to this binding's restrictions. + // See "id" in the [G Suite Directory API's Groups resource] + // (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource). + // If a group's email address/alias is changed, this resource will continue + // to point at the changed group. This field does not accept group email + // addresses or aliases. + // Example: "01d520gv4vjcrht" + string group_key = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Access level that a user must have to be granted access. Only one access + // level is supported, not multiple. This repeated field must have exactly + // one element. + // Example: "accessPolicies/9522/accessLevels/device_trusted" + repeated string access_levels = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto new file mode 100644 index 00000000000..d135380e788 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto @@ -0,0 +1,472 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "ServicePerimeterProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// `ServicePerimeter` describes a set of Google Cloud resources which can freely +// import and export data amongst themselves, but not export outside of the +// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` +// has a target outside of the `ServicePerimeter`, the request will be blocked. +// Otherwise the request is allowed. There are two types of Service Perimeter - +// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +// Google Cloud project can only belong to a single regular Service Perimeter. +// Service Perimeter Bridges can contain only Google Cloud projects as members, +// a single Google Cloud project may belong to multiple Service Perimeter +// Bridges. +message ServicePerimeter { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + pattern: "accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}" + }; + + // Specifies the type of the Perimeter. There are two types: regular and + // bridge. Regular Service Perimeter contains resources, access levels, and + // restricted services. Every resource can be in at most ONE + // regular Service Perimeter. + // + // In addition to being in a regular service perimeter, a resource can also + // be in zero or more perimeter bridges. A perimeter bridge only contains + // resources. Cross project operations are permitted if all effected + // resources share some perimeter (whether bridge or regular). Perimeter + // Bridge does not contain access levels or services: those are governed + // entirely by the regular perimeter that resource is in. + // + // Perimeter Bridges are typically useful when building more complex toplogies + // with many independent perimeters that need to share some data with a common + // perimeter, but should not be able to share data among themselves. + enum PerimeterType { + // Regular Perimeter. + PERIMETER_TYPE_REGULAR = 0; + + // Perimeter Bridge. + PERIMETER_TYPE_BRIDGE = 1; + } + + // Required. Resource name for the ServicePerimeter. The `short_name` + // component must begin with a letter and only include alphanumeric and '_'. + // Format: + // `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}` + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `ServicePerimeter` and its use. Does not affect + // behavior. + string description = 3; + + // Output only. Time the `ServicePerimeter` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `ServicePerimeter` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Perimeter type indicator. A single project is + // allowed to be a member of single regular perimeter, but multiple service + // perimeter bridges. A project cannot be a included in a perimeter bridge + // without being included in regular perimeter. For perimeter bridges, + // the restricted service list as well as access level lists must be + // empty. + PerimeterType perimeter_type = 6; + + // Current ServicePerimeter configuration. Specifies sets of resources, + // restricted services and access levels that determine perimeter + // content and boundaries. + ServicePerimeterConfig status = 7; + + // Proposed (or dry run) ServicePerimeter configuration. This configuration + // allows to specify and test ServicePerimeter configuration without enforcing + // actual access restrictions. Only allowed to be set when the + // "use_explicit_dry_run_spec" flag is set. + ServicePerimeterConfig spec = 8; + + // Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly + // exists for all Service Perimeters, and that spec is identical to the + // status for those Service Perimeters. When this flag is set, it inhibits the + // generation of the implicit spec, thereby allowing the user to explicitly + // provide a configuration ("spec") to use in a dry-run version of the Service + // Perimeter. This allows the user to test changes to the enforced config + // ("status") without actually enforcing them. This testing is done through + // analyzing the differences between currently enforced and suggested + // restrictions. use_explicit_dry_run_spec must bet set to True if any of the + // fields in the spec are set to non-default values. + bool use_explicit_dry_run_spec = 9; +} + +// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +// describe specific Service Perimeter configuration. +message ServicePerimeterConfig { + // Specifies how APIs are allowed to communicate within the Service + // Perimeter. + message VpcAccessibleServices { + // Whether to restrict API calls within the Service Perimeter to the list of + // APIs specified in 'allowed_services'. + bool enable_restriction = 1; + + // The list of APIs usable within the Service Perimeter. Must be empty + // unless 'enable_restriction' is True. You can specify a list of individual + // services, as well as include the 'RESTRICTED-SERVICES' value, which + // automatically includes all of the services protected by the perimeter. + repeated string allowed_services = 2; + } + + // Specifies the types of identities that are allowed access in either + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] + // or [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom] + // rules. + enum IdentityType { + // No blanket identity group specified. + IDENTITY_TYPE_UNSPECIFIED = 0; + + // Authorize access from all identities outside the perimeter. + ANY_IDENTITY = 1; + + // Authorize access from all human users outside the perimeter. + ANY_USER_ACCOUNT = 2; + + // Authorize access from all service accounts outside the perimeter. + ANY_SERVICE_ACCOUNT = 3; + } + + // An allowed method or permission of a service specified in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + message MethodSelector { + // The API method name or Cloud IAM permission name to allow. + oneof kind { + // Value for `method` should be a valid method name for the corresponding + // `service_name` in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + // If `*` used as value for `method`, then ALL methods and permissions are + // allowed. + string method = 1; + + // Value for `permission` should be a valid Cloud IAM permission for the + // corresponding `service_name` in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + string permission = 2; + } + } + + // Identification for an API Operation. + message ApiOperation { + // The name of the API whose methods or permissions the [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // or [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // want to allow. A single [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // with `service_name` field set to `*` will allow all methods AND + // permissions for all services. + string service_name = 1; + + // API methods or permissions to allow. Method or permission must belong to + // the service specified by `service_name` field. A single [MethodSelector] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector] + // entry with `*` specified for the `method` field will allow all methods + // AND permissions for the service specified in `service_name`. + repeated MethodSelector method_selectors = 2; + } + + // The source that [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // authorizes access from. + message IngressSource { + // Allowed ingress source. It can be one of [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] or Google + // Cloud resource. + oneof source { + // An [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] resource + // name that allow resources within the [ServicePerimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to be + // accessed from the internet. [AccessLevels] + // [google.identity.accesscontextmanager.v1.AccessLevel] listed must + // be in the same policy as this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // Referencing a nonexistent [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] will cause + // an error. If no [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `accessPolicies/MY_POLICY/accessLevels/MY_LEVEL`. If a single `*` is + // specified for `access_level`, then all [IngressSources] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource] + // will be allowed. + string access_level = 1; + + // A Google Cloud resource that is allowed to ingress the perimeter. + // Requests from these resources will be allowed to access perimeter data. + // Currently only projects are allowed. + // Format: `projects/{project_number}` + // The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, the + // case of allowing all Google Cloud resources only is not supported. + string resource = 2; + } + } + + // Defines the conditions under which an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request. Conditions are based on information about the source of + // the request. The request must satisfy what is defined in `sources` AND + // identity related fields in order to match. + message IngressFrom { + // Sources that this [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // authorizes access from. + repeated IngressSource sources = 1; + + // A list of identities that are allowed access through this ingress + // policy. Should be in the format of email address. The email address + // should represent individual user or service account only. + repeated string identities = 2; + + // Specifies the type of identities that are allowed access from outside the + // perimeter. If left unspecified, then members of `identities` field will + // be allowed access. + IdentityType identity_type = 3; + } + + // Defines the conditions under which an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request. Conditions are based on information about the + // [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // intended to be performed on the target resource of the request. The request + // must satisfy what is defined in `operations` AND `resources` in order to + // match. + message IngressTo { + // A list of [ApiOperations] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // allowed to be performed by the sources specified in corresponding + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] + // in this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + repeated ApiOperation operations = 1; + + // A list of resources, currently only projects in the form + // `projects/`, protected by this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] that are + // allowed to be accessed by sources defined in the corresponding + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom]. + // If a single `*` is specified, then access to all resources inside the + // perimeter are allowed. + repeated string resources = 2; + } + + // Policy for ingress into [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // match requests based on `ingress_from` and `ingress_to` stanzas. For an + // ingress policy to match, both the `ingress_from` and `ingress_to` stanzas + // must be matched. If an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request, the request is allowed through the perimeter boundary + // from outside the perimeter. + // + // For example, access from the internet can be allowed either + // based on an [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] or, for traffic + // hosted on Google Cloud, the project of the source network. For access from + // private networks, using the project of the hosting network is required. + // + // Individual ingress policies can be limited by restricting which + // services and/or actions they match using the `ingress_to` field. + message IngressPolicy { + // Defines the conditions on the source of a request causing this + // [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply. + IngressFrom ingress_from = 1; + + // Defines the conditions on the [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // and request destination that cause this [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply. + IngressTo ingress_to = 2; + } + + // Defines the conditions under which an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request. Conditions based on information about the source of the + // request. Note that if the destination of the request is also protected by a + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + // an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // which allows access in order for this request to succeed. + message EgressFrom { + // A list of identities that are allowed access through this [EgressPolicy]. + // Should be in the format of email address. The email address should + // represent individual user or service account only. + repeated string identities = 1; + + // Specifies the type of identities that are allowed access to outside the + // perimeter. If left unspecified, then members of `identities` field will + // be allowed access. + IdentityType identity_type = 2; + } + + // Defines the conditions under which an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request. Conditions are based on information about the + // [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // intended to be performed on the `resources` specified. Note that if the + // destination of the request is also protected by a [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + // an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // which allows access in order for this request to succeed. The request must + // match `operations` AND `resources` fields in order to be allowed egress out + // of the perimeter. + message EgressTo { + // A list of resources, currently only projects in the form + // `projects/`, that are allowed to be accessed by sources + // defined in the corresponding [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + // A request matches if it contains a resource in this list. If `*` is + // specified for `resources`, then this [EgressTo] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo] + // rule will authorize access to all resources outside the perimeter. + repeated string resources = 1; + + // A list of [ApiOperations] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // allowed to be performed by the sources specified in the corresponding + // [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + // A request matches if it uses an operation/service in this list. + repeated ApiOperation operations = 2; + + // A list of external resources that are allowed to be accessed. Only AWS + // and Azure resources are supported. For Amazon S3, the supported format is + // s3://BUCKET_NAME. For Azure Storage, the supported format is + // azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches + // if it contains an external resource in this list (Example: + // s3://bucket/path). Currently '*' is not allowed. + repeated string external_resources = 3; + } + + // Policy for egress from perimeter. + // + // [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // match requests based on `egress_from` and `egress_to` stanzas. For an + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to match, both `egress_from` and `egress_to` stanzas must be matched. If an + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request, the request is allowed to span the [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] boundary. + // For example, an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // can be used to allow VMs on networks within the [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to access a + // defined set of projects outside the perimeter in certain contexts (e.g. to + // read data from a Cloud Storage bucket or query against a BigQuery dataset). + // + // [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // are concerned with the *resources* that a request relates as well as the + // API services and API actions being used. They do not related to the + // direction of data movement. More detailed documentation for this concept + // can be found in the descriptions of [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom] + // and [EgressTo] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo]. + message EgressPolicy { + // Defines conditions on the source of a request causing this [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply. + EgressFrom egress_from = 1; + + // Defines the conditions on the [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // and destination resources that cause this [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply. + EgressTo egress_to = 2; + } + + // A list of Google Cloud resources that are inside of the service perimeter. + // Currently only projects are allowed. Format: `projects/{project_number}` + repeated string resources = 1; + + // A list of `AccessLevel` resource names that allow resources within the + // `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed + // must be in the same policy as this `ServicePerimeter`. Referencing a + // nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. + // For Service Perimeter Bridge, must be empty. + repeated string access_levels = 2; + + // Google Cloud services that are subject to the Service Perimeter + // restrictions. For example, if `storage.googleapis.com` is specified, access + // to the storage buckets inside the perimeter must meet the perimeter's + // access restrictions. + repeated string restricted_services = 4; + + // Configuration for APIs allowed within Perimeter. + VpcAccessibleServices vpc_accessible_services = 10; + + // List of [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply to the perimeter. A perimeter may have multiple [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy], + // each of which is evaluated separately. Access is granted if any [Ingress + // Policy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // grants it. Must be empty for a perimeter bridge. + repeated IngressPolicy ingress_policies = 8; + + // List of [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply to the perimeter. A perimeter may have multiple [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy], + // each of which is evaluated separately. Access is granted if any + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // grants it. Must be empty for a perimeter bridge. + repeated EgressPolicy egress_policies = 9; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.d.ts b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.d.ts new file mode 100644 index 00000000000..127a4807755 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.d.ts @@ -0,0 +1,12537 @@ +// Copyright 2024 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace asset. */ + namespace asset { + + /** Namespace v1p2beta1. */ + namespace v1p2beta1 { + + /** 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 CreateFeed. + * @param request CreateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback): void; + + /** + * Calls CreateFeed. + * @param request CreateFeedRequest message or plain object + * @returns Promise + */ + public createFeed(request: google.cloud.asset.v1p2beta1.ICreateFeedRequest): Promise; + + /** + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback): void; + + /** + * Calls GetFeed. + * @param request GetFeedRequest message or plain object + * @returns Promise + */ + public getFeed(request: google.cloud.asset.v1p2beta1.IGetFeedRequest): Promise; + + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFeedsResponse + */ + public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest, callback: google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback): void; + + /** + * Calls ListFeeds. + * @param request ListFeedsRequest message or plain object + * @returns Promise + */ + public listFeeds(request: google.cloud.asset.v1p2beta1.IListFeedsRequest): Promise; + + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Feed + */ + public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback): void; + + /** + * Calls UpdateFeed. + * @param request UpdateFeedRequest message or plain object + * @returns Promise + */ + public updateFeed(request: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): Promise; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, callback: google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback): void; + + /** + * Calls DeleteFeed. + * @param request DeleteFeedRequest message or plain object + * @returns Promise + */ + public deleteFeed(request: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|createFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type CreateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|getFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type GetFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|listFeeds}. + * @param error Error, if any + * @param [response] ListFeedsResponse + */ + type ListFeedsCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.ListFeedsResponse) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|updateFeed}. + * @param error Error, if any + * @param [response] Feed + */ + type UpdateFeedCallback = (error: (Error|null), response?: google.cloud.asset.v1p2beta1.Feed) => void; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|deleteFeed}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFeedCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { + + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + } + + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { + + /** + * Constructs a new ExportAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IExportAssetsResponse); + + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p2beta1.IOutputConfig|null); + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IExportAssetsResponse): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + + /** + * Verifies an ExportAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ExportAssetsResponse; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchGetAssetsHistoryResponse. */ + interface IBatchGetAssetsHistoryResponse { + + /** BatchGetAssetsHistoryResponse assets */ + assets?: (google.cloud.asset.v1p2beta1.ITemporalAsset[]|null); + } + + /** Represents a BatchGetAssetsHistoryResponse. */ + class BatchGetAssetsHistoryResponse implements IBatchGetAssetsHistoryResponse { + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse); + + /** BatchGetAssetsHistoryResponse assets. */ + public assets: google.cloud.asset.v1p2beta1.ITemporalAsset[]; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchGetAssetsHistoryResponse instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @param message BatchGetAssetsHistoryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + + /** + * Verifies a BatchGetAssetsHistoryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchGetAssetsHistoryResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @param message BatchGetAssetsHistoryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchGetAssetsHistoryResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFeedRequest. */ + interface ICreateFeedRequest { + + /** CreateFeedRequest parent */ + parent?: (string|null); + + /** CreateFeedRequest feedId */ + feedId?: (string|null); + + /** CreateFeedRequest feed */ + feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + } + + /** Represents a CreateFeedRequest. */ + class CreateFeedRequest implements ICreateFeedRequest { + + /** + * Constructs a new CreateFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest); + + /** CreateFeedRequest parent. */ + public parent: string; + + /** CreateFeedRequest feedId. */ + public feedId: string; + + /** CreateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + + /** + * Creates a new CreateFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.ICreateFeedRequest): google.cloud.asset.v1p2beta1.CreateFeedRequest; + + /** + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @param message CreateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ICreateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.CreateFeedRequest; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.CreateFeedRequest; + + /** + * Verifies a CreateFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.CreateFeedRequest; + + /** + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @param message CreateFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.CreateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFeedRequest. */ + interface IGetFeedRequest { + + /** GetFeedRequest name */ + name?: (string|null); + } + + /** Represents a GetFeedRequest. */ + class GetFeedRequest implements IGetFeedRequest { + + /** + * Constructs a new GetFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest); + + /** GetFeedRequest name. */ + public name: string; + + /** + * Creates a new GetFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IGetFeedRequest): google.cloud.asset.v1p2beta1.GetFeedRequest; + + /** + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @param message GetFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IGetFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.GetFeedRequest; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.GetFeedRequest; + + /** + * Verifies a GetFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.GetFeedRequest; + + /** + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @param message GetFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.GetFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFeedsRequest. */ + interface IListFeedsRequest { + + /** ListFeedsRequest parent */ + parent?: (string|null); + } + + /** Represents a ListFeedsRequest. */ + class ListFeedsRequest implements IListFeedsRequest { + + /** + * Constructs a new ListFeedsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest); + + /** ListFeedsRequest parent. */ + public parent: string; + + /** + * Creates a new ListFeedsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFeedsRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsRequest): google.cloud.asset.v1p2beta1.ListFeedsRequest; + + /** + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @param message ListFeedsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ListFeedsRequest; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ListFeedsRequest; + + /** + * Verifies a ListFeedsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFeedsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsRequest; + + /** + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @param message ListFeedsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFeedsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFeedsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFeedsResponse. */ + interface IListFeedsResponse { + + /** ListFeedsResponse feeds */ + feeds?: (google.cloud.asset.v1p2beta1.IFeed[]|null); + } + + /** Represents a ListFeedsResponse. */ + class ListFeedsResponse implements IListFeedsResponse { + + /** + * Constructs a new ListFeedsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse); + + /** ListFeedsResponse feeds. */ + public feeds: google.cloud.asset.v1p2beta1.IFeed[]; + + /** + * Creates a new ListFeedsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFeedsResponse instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IListFeedsResponse): google.cloud.asset.v1p2beta1.ListFeedsResponse; + + /** + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @param message ListFeedsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IListFeedsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.ListFeedsResponse; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.ListFeedsResponse; + + /** + * Verifies a ListFeedsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFeedsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.ListFeedsResponse; + + /** + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @param message ListFeedsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.ListFeedsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFeedsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFeedsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateFeedRequest. */ + interface IUpdateFeedRequest { + + /** UpdateFeedRequest feed */ + feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + + /** UpdateFeedRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFeedRequest. */ + class UpdateFeedRequest implements IUpdateFeedRequest { + + /** + * Constructs a new UpdateFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest); + + /** UpdateFeedRequest feed. */ + public feed?: (google.cloud.asset.v1p2beta1.IFeed|null); + + /** UpdateFeedRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IUpdateFeedRequest): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + + /** + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @param message UpdateFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IUpdateFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + + /** + * Verifies an UpdateFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.UpdateFeedRequest; + + /** + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @param message UpdateFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.UpdateFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFeedRequest. */ + interface IDeleteFeedRequest { + + /** DeleteFeedRequest name */ + name?: (string|null); + } + + /** Represents a DeleteFeedRequest. */ + class DeleteFeedRequest implements IDeleteFeedRequest { + + /** + * Constructs a new DeleteFeedRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest); + + /** DeleteFeedRequest name. */ + public name: string; + + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFeedRequest instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IDeleteFeedRequest): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + + /** + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @param message DeleteFeedRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IDeleteFeedRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + + /** + * Verifies a DeleteFeedRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFeedRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.DeleteFeedRequest; + + /** + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @param message DeleteFeedRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.DeleteFeedRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFeedRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFeedRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1p2beta1.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IOutputConfig): google.cloud.asset.v1p2beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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.v1p2beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri?: (string|null); + + /** GcsDestination objectUri. */ + public objectUri?: "uri"; + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IGcsDestination): google.cloud.asset.v1p2beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @param message GcsDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.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.v1p2beta1.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.v1p2beta1.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.v1p2beta1.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.v1p2beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2 + } + + /** Properties of a PubsubDestination. */ + interface IPubsubDestination { + + /** PubsubDestination topic */ + topic?: (string|null); + } + + /** Represents a PubsubDestination. */ + class PubsubDestination implements IPubsubDestination { + + /** + * Constructs a new PubsubDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination); + + /** PubsubDestination topic. */ + public topic: string; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns PubsubDestination instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IPubsubDestination): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @param message PubsubDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IPubsubDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Verifies a PubsubDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubsubDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.PubsubDestination; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @param message PubsubDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.PubsubDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubsubDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PubsubDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FeedOutputConfig. */ + interface IFeedOutputConfig { + + /** FeedOutputConfig pubsubDestination */ + pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + } + + /** Represents a FeedOutputConfig. */ + class FeedOutputConfig implements IFeedOutputConfig { + + /** + * Constructs a new FeedOutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig); + + /** FeedOutputConfig pubsubDestination. */ + public pubsubDestination?: (google.cloud.asset.v1p2beta1.IPubsubDestination|null); + + /** FeedOutputConfig destination. */ + public destination?: "pubsubDestination"; + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FeedOutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IFeedOutputConfig): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @param message FeedOutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeedOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Verifies a FeedOutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeedOutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.FeedOutputConfig; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @param message FeedOutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.FeedOutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeedOutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeedOutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Feed. */ + interface IFeed { + + /** Feed name */ + name?: (string|null); + + /** Feed assetNames */ + assetNames?: (string[]|null); + + /** Feed assetTypes */ + assetTypes?: (string[]|null); + + /** Feed contentType */ + contentType?: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType|null); + + /** Feed feedOutputConfig */ + feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + } + + /** Represents a Feed. */ + class Feed implements IFeed { + + /** + * Constructs a new Feed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IFeed); + + /** Feed name. */ + public name: string; + + /** Feed assetNames. */ + public assetNames: string[]; + + /** Feed assetTypes. */ + public assetTypes: string[]; + + /** Feed contentType. */ + public contentType: (google.cloud.asset.v1p2beta1.ContentType|keyof typeof google.cloud.asset.v1p2beta1.ContentType); + + /** Feed feedOutputConfig. */ + public feedOutputConfig?: (google.cloud.asset.v1p2beta1.IFeedOutputConfig|null); + + /** + * Creates a new Feed instance using the specified properties. + * @param [properties] Properties to set + * @returns Feed instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IFeed): google.cloud.asset.v1p2beta1.Feed; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @param message Feed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Feed; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Feed; + + /** + * Verifies a Feed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Feed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Feed; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @param message Feed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Feed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Feed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Feed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TemporalAsset. */ + interface ITemporalAsset { + + /** TemporalAsset window */ + window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + + /** TemporalAsset deleted */ + deleted?: (boolean|null); + + /** TemporalAsset asset */ + asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + } + + /** Represents a TemporalAsset. */ + class TemporalAsset implements ITemporalAsset { + + /** + * Constructs a new TemporalAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset); + + /** TemporalAsset window. */ + public window?: (google.cloud.asset.v1p2beta1.ITimeWindow|null); + + /** TemporalAsset deleted. */ + public deleted: boolean; + + /** TemporalAsset asset. */ + public asset?: (google.cloud.asset.v1p2beta1.IAsset|null); + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns TemporalAsset instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.ITemporalAsset): google.cloud.asset.v1p2beta1.TemporalAsset; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @param message TemporalAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITemporalAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.TemporalAsset; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.TemporalAsset; + + /** + * Verifies a TemporalAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TemporalAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TemporalAsset; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @param message TemporalAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.TemporalAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TemporalAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TemporalAsset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeWindow. */ + interface ITimeWindow { + + /** TimeWindow startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TimeWindow. */ + class TimeWindow implements ITimeWindow { + + /** + * Constructs a new TimeWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.ITimeWindow); + + /** TimeWindow startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TimeWindow endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TimeWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeWindow instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.ITimeWindow): google.cloud.asset.v1p2beta1.TimeWindow; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * @param message TimeWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.ITimeWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.TimeWindow; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.TimeWindow; + + /** + * Verifies a TimeWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.TimeWindow; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @param message TimeWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.TimeWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1p2beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IAsset): google.cloud.asset.v1p2beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p2beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p2beta1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p2beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p2beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p2beta1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1p2beta1.IResource): google.cloud.asset.v1p2beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p2beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @param message Resource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p2beta1.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.v1p2beta1.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.v1p2beta1.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.v1p2beta1.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.v1p2beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace orgpolicy. */ + namespace orgpolicy { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy constraint */ + constraint?: (string|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + + /** Policy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Policy listPolicy */ + listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); + + /** Policy booleanPolicy */ + booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); + + /** Policy restoreDefault */ + restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy constraint. */ + public constraint: string; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** Policy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Policy listPolicy. */ + public listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); + + /** Policy booleanPolicy. */ + public booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); + + /** Policy restoreDefault. */ + public restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + + /** Policy policyType. */ + public policyType?: ("listPolicy"|"booleanPolicy"|"restoreDefault"); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.IPolicy): google.cloud.orgpolicy.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.orgpolicy.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.orgpolicy.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Policy { + + /** Properties of a ListPolicy. */ + interface IListPolicy { + + /** ListPolicy allowedValues */ + allowedValues?: (string[]|null); + + /** ListPolicy deniedValues */ + deniedValues?: (string[]|null); + + /** ListPolicy allValues */ + allValues?: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null); + + /** ListPolicy suggestedValue */ + suggestedValue?: (string|null); + + /** ListPolicy inheritFromParent */ + inheritFromParent?: (boolean|null); + } + + /** Represents a ListPolicy. */ + class ListPolicy implements IListPolicy { + + /** + * Constructs a new ListPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy); + + /** ListPolicy allowedValues. */ + public allowedValues: string[]; + + /** ListPolicy deniedValues. */ + public deniedValues: string[]; + + /** ListPolicy allValues. */ + public allValues: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues); + + /** ListPolicy suggestedValue. */ + public suggestedValue: string; + + /** ListPolicy inheritFromParent. */ + public inheritFromParent: boolean; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; + + /** + * Verifies a ListPolicy 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 ListPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @param message ListPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.ListPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListPolicy { + + /** AllValues enum. */ + enum AllValues { + ALL_VALUES_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + } + + /** Properties of a BooleanPolicy. */ + interface IBooleanPolicy { + + /** BooleanPolicy enforced */ + enforced?: (boolean|null); + } + + /** Represents a BooleanPolicy. */ + class BooleanPolicy implements IBooleanPolicy { + + /** + * Constructs a new BooleanPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy); + + /** BooleanPolicy enforced. */ + public enforced: boolean; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BooleanPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Verifies a BooleanPolicy 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 BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BooleanPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @param message BooleanPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.BooleanPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BooleanPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BooleanPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDefault. */ + interface IRestoreDefault { + } + + /** Represents a RestoreDefault. */ + class RestoreDefault implements IRestoreDefault { + + /** + * Constructs a new RestoreDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault); + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDefault instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Verifies a RestoreDefault 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 RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDefault + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @param message RestoreDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.RestoreDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace identity. */ + namespace identity { + + /** Namespace accesscontextmanager. */ + namespace accesscontextmanager { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AccessLevel. */ + interface IAccessLevel { + + /** AccessLevel name */ + name?: (string|null); + + /** AccessLevel title */ + title?: (string|null); + + /** AccessLevel description */ + description?: (string|null); + + /** AccessLevel basic */ + basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom */ + custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AccessLevel. */ + class AccessLevel implements IAccessLevel { + + /** + * Constructs a new AccessLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessLevel); + + /** AccessLevel name. */ + public name: string; + + /** AccessLevel title. */ + public title: string; + + /** AccessLevel description. */ + public description: string; + + /** AccessLevel basic. */ + public basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom. */ + public custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel level. */ + public level?: ("basic"|"custom"); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessLevel): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Verifies an AccessLevel 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 AccessLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @param message AccessLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BasicLevel. */ + interface IBasicLevel { + + /** BasicLevel conditions */ + conditions?: (google.identity.accesscontextmanager.v1.ICondition[]|null); + + /** BasicLevel combiningFunction */ + combiningFunction?: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null); + } + + /** Represents a BasicLevel. */ + class BasicLevel implements IBasicLevel { + + /** + * Constructs a new BasicLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IBasicLevel); + + /** BasicLevel conditions. */ + public conditions: google.identity.accesscontextmanager.v1.ICondition[]; + + /** BasicLevel combiningFunction. */ + public combiningFunction: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction); + + /** + * Creates a new BasicLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IBasicLevel): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Verifies a BasicLevel 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 BasicLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @param message BasicLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.BasicLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BasicLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BasicLevel { + + /** ConditionCombiningFunction enum. */ + enum ConditionCombiningFunction { + AND = 0, + OR = 1 + } + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition ipSubnetworks */ + ipSubnetworks?: (string[]|null); + + /** Condition devicePolicy */ + devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels */ + requiredAccessLevels?: (string[]|null); + + /** Condition negate */ + negate?: (boolean|null); + + /** Condition members */ + members?: (string[]|null); + + /** Condition regions */ + regions?: (string[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICondition); + + /** Condition ipSubnetworks. */ + public ipSubnetworks: string[]; + + /** Condition devicePolicy. */ + public devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels. */ + public requiredAccessLevels: string[]; + + /** Condition negate. */ + public negate: boolean; + + /** Condition members. */ + public members: string[]; + + /** Condition regions. */ + public regions: string[]; + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICondition): google.identity.accesscontextmanager.v1.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Verifies a Condition 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 Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomLevel. */ + interface ICustomLevel { + + /** CustomLevel expr */ + expr?: (google.type.IExpr|null); + } + + /** Represents a CustomLevel. */ + class CustomLevel implements ICustomLevel { + + /** + * Constructs a new CustomLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICustomLevel); + + /** CustomLevel expr. */ + public expr?: (google.type.IExpr|null); + + /** + * Creates a new CustomLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICustomLevel): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Verifies a CustomLevel 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 CustomLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @param message CustomLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.CustomLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DevicePolicy. */ + interface IDevicePolicy { + + /** DevicePolicy requireScreenlock */ + requireScreenlock?: (boolean|null); + + /** DevicePolicy allowedEncryptionStatuses */ + allowedEncryptionStatuses?: (google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]|null); + + /** DevicePolicy osConstraints */ + osConstraints?: (google.identity.accesscontextmanager.v1.IOsConstraint[]|null); + + /** DevicePolicy allowedDeviceManagementLevels */ + allowedDeviceManagementLevels?: (google.identity.accesscontextmanager.type.DeviceManagementLevel[]|null); + + /** DevicePolicy requireAdminApproval */ + requireAdminApproval?: (boolean|null); + + /** DevicePolicy requireCorpOwned */ + requireCorpOwned?: (boolean|null); + } + + /** Represents a DevicePolicy. */ + class DevicePolicy implements IDevicePolicy { + + /** + * Constructs a new DevicePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy); + + /** DevicePolicy requireScreenlock. */ + public requireScreenlock: boolean; + + /** DevicePolicy allowedEncryptionStatuses. */ + public allowedEncryptionStatuses: google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]; + + /** DevicePolicy osConstraints. */ + public osConstraints: google.identity.accesscontextmanager.v1.IOsConstraint[]; + + /** DevicePolicy allowedDeviceManagementLevels. */ + public allowedDeviceManagementLevels: google.identity.accesscontextmanager.type.DeviceManagementLevel[]; + + /** DevicePolicy requireAdminApproval. */ + public requireAdminApproval: boolean; + + /** DevicePolicy requireCorpOwned. */ + public requireCorpOwned: boolean; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DevicePolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Verifies a DevicePolicy 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 DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DevicePolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @param message DevicePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.DevicePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DevicePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DevicePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OsConstraint. */ + interface IOsConstraint { + + /** OsConstraint osType */ + osType?: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType|null); + + /** OsConstraint minimumVersion */ + minimumVersion?: (string|null); + + /** OsConstraint requireVerifiedChromeOs */ + requireVerifiedChromeOs?: (boolean|null); + } + + /** Represents an OsConstraint. */ + class OsConstraint implements IOsConstraint { + + /** + * Constructs a new OsConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IOsConstraint); + + /** OsConstraint osType. */ + public osType: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType); + + /** OsConstraint minimumVersion. */ + public minimumVersion: string; + + /** OsConstraint requireVerifiedChromeOs. */ + public requireVerifiedChromeOs: boolean; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns OsConstraint instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IOsConstraint): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Verifies an OsConstraint 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 OsConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsConstraint + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @param message OsConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.OsConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessPolicy. */ + interface IAccessPolicy { + + /** AccessPolicy name */ + name?: (string|null); + + /** AccessPolicy parent */ + parent?: (string|null); + + /** AccessPolicy title */ + title?: (string|null); + + /** AccessPolicy scopes */ + scopes?: (string[]|null); + + /** AccessPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag */ + etag?: (string|null); + } + + /** Represents an AccessPolicy. */ + class AccessPolicy implements IAccessPolicy { + + /** + * Constructs a new AccessPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy); + + /** AccessPolicy name. */ + public name: string; + + /** AccessPolicy parent. */ + public parent: string; + + /** AccessPolicy title. */ + public title: string; + + /** AccessPolicy scopes. */ + public scopes: string[]; + + /** AccessPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag. */ + public etag: string; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Verifies an AccessPolicy 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 AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @param message AccessPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicePerimeter. */ + interface IServicePerimeter { + + /** ServicePerimeter name */ + name?: (string|null); + + /** ServicePerimeter title */ + title?: (string|null); + + /** ServicePerimeter description */ + description?: (string|null); + + /** ServicePerimeter createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType */ + perimeterType?: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null); + + /** ServicePerimeter status */ + status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec */ + spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec */ + useExplicitDryRunSpec?: (boolean|null); + } + + /** Represents a ServicePerimeter. */ + class ServicePerimeter implements IServicePerimeter { + + /** + * Constructs a new ServicePerimeter. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter); + + /** ServicePerimeter name. */ + public name: string; + + /** ServicePerimeter title. */ + public title: string; + + /** ServicePerimeter description. */ + public description: string; + + /** ServicePerimeter createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType. */ + public perimeterType: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType); + + /** ServicePerimeter status. */ + public status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec. */ + public spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec. */ + public useExplicitDryRunSpec: boolean; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeter instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Verifies a ServicePerimeter 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 ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeter + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @param message ServicePerimeter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServicePerimeter { + + /** PerimeterType enum. */ + enum PerimeterType { + PERIMETER_TYPE_REGULAR = 0, + PERIMETER_TYPE_BRIDGE = 1 + } + } + + /** Properties of a ServicePerimeterConfig. */ + interface IServicePerimeterConfig { + + /** ServicePerimeterConfig resources */ + resources?: (string[]|null); + + /** ServicePerimeterConfig accessLevels */ + accessLevels?: (string[]|null); + + /** ServicePerimeterConfig restrictedServices */ + restrictedServices?: (string[]|null); + + /** ServicePerimeterConfig vpcAccessibleServices */ + vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** ServicePerimeterConfig ingressPolicies */ + ingressPolicies?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy[]|null); + + /** ServicePerimeterConfig egressPolicies */ + egressPolicies?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy[]|null); + } + + /** Represents a ServicePerimeterConfig. */ + class ServicePerimeterConfig implements IServicePerimeterConfig { + + /** + * Constructs a new ServicePerimeterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig); + + /** ServicePerimeterConfig resources. */ + public resources: string[]; + + /** ServicePerimeterConfig accessLevels. */ + public accessLevels: string[]; + + /** ServicePerimeterConfig restrictedServices. */ + public restrictedServices: string[]; + + /** ServicePerimeterConfig vpcAccessibleServices. */ + public vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** ServicePerimeterConfig ingressPolicies. */ + public ingressPolicies: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy[]; + + /** ServicePerimeterConfig egressPolicies. */ + public egressPolicies: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy[]; + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeterConfig instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Verifies a ServicePerimeterConfig 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 ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeterConfig + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @param message ServicePerimeterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServicePerimeterConfig { + + /** Properties of a VpcAccessibleServices. */ + interface IVpcAccessibleServices { + + /** VpcAccessibleServices enableRestriction */ + enableRestriction?: (boolean|null); + + /** VpcAccessibleServices allowedServices */ + allowedServices?: (string[]|null); + } + + /** Represents a VpcAccessibleServices. */ + class VpcAccessibleServices implements IVpcAccessibleServices { + + /** + * Constructs a new VpcAccessibleServices. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices); + + /** VpcAccessibleServices enableRestriction. */ + public enableRestriction: boolean; + + /** VpcAccessibleServices allowedServices. */ + public allowedServices: string[]; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcAccessibleServices instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Verifies a VpcAccessibleServices 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 VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcAccessibleServices + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @param message VpcAccessibleServices + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcAccessibleServices + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IdentityType enum. */ + enum IdentityType { + IDENTITY_TYPE_UNSPECIFIED = 0, + ANY_IDENTITY = 1, + ANY_USER_ACCOUNT = 2, + ANY_SERVICE_ACCOUNT = 3 + } + + /** Properties of a MethodSelector. */ + interface IMethodSelector { + + /** MethodSelector method */ + method?: (string|null); + + /** MethodSelector permission */ + permission?: (string|null); + } + + /** Represents a MethodSelector. */ + class MethodSelector implements IMethodSelector { + + /** + * Constructs a new MethodSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector); + + /** MethodSelector method. */ + public method?: (string|null); + + /** MethodSelector permission. */ + public permission?: (string|null); + + /** MethodSelector kind. */ + public kind?: ("method"|"permission"); + + /** + * Creates a new MethodSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSelector instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Encodes the specified MethodSelector message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @param message MethodSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSelector message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @param message MethodSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSelector + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Decodes a MethodSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSelector + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Verifies a MethodSelector 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 MethodSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSelector + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Creates a plain object from a MethodSelector message. Also converts values to other types if specified. + * @param message MethodSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiOperation. */ + interface IApiOperation { + + /** ApiOperation serviceName */ + serviceName?: (string|null); + + /** ApiOperation methodSelectors */ + methodSelectors?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector[]|null); + } + + /** Represents an ApiOperation. */ + class ApiOperation implements IApiOperation { + + /** + * Constructs a new ApiOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation); + + /** ApiOperation serviceName. */ + public serviceName: string; + + /** ApiOperation methodSelectors. */ + public methodSelectors: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector[]; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiOperation instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiOperation + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiOperation + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Verifies an ApiOperation 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 ApiOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiOperation + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @param message ApiOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressSource. */ + interface IIngressSource { + + /** IngressSource accessLevel */ + accessLevel?: (string|null); + + /** IngressSource resource */ + resource?: (string|null); + } + + /** Represents an IngressSource. */ + class IngressSource implements IIngressSource { + + /** + * Constructs a new IngressSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource); + + /** IngressSource accessLevel. */ + public accessLevel?: (string|null); + + /** IngressSource resource. */ + public resource?: (string|null); + + /** IngressSource source. */ + public source?: ("accessLevel"|"resource"); + + /** + * Creates a new IngressSource instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressSource instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Encodes the specified IngressSource message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @param message IngressSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressSource message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @param message IngressSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressSource + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Decodes an IngressSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressSource + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Verifies an IngressSource 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 IngressSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressSource + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Creates a plain object from an IngressSource message. Also converts values to other types if specified. + * @param message IngressSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressFrom. */ + interface IIngressFrom { + + /** IngressFrom sources */ + sources?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource[]|null); + + /** IngressFrom identities */ + identities?: (string[]|null); + + /** IngressFrom identityType */ + identityType?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null); + } + + /** Represents an IngressFrom. */ + class IngressFrom implements IIngressFrom { + + /** + * Constructs a new IngressFrom. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom); + + /** IngressFrom sources. */ + public sources: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource[]; + + /** IngressFrom identities. */ + public identities: string[]; + + /** IngressFrom identityType. */ + public identityType: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType); + + /** + * Creates a new IngressFrom instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressFrom instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Encodes the specified IngressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @param message IngressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @param message IngressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressFrom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Decodes an IngressFrom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Verifies an IngressFrom 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 IngressFrom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressFrom + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Creates a plain object from an IngressFrom message. Also converts values to other types if specified. + * @param message IngressFrom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressFrom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressFrom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressTo. */ + interface IIngressTo { + + /** IngressTo operations */ + operations?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]|null); + + /** IngressTo resources */ + resources?: (string[]|null); + } + + /** Represents an IngressTo. */ + class IngressTo implements IIngressTo { + + /** + * Constructs a new IngressTo. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo); + + /** IngressTo operations. */ + public operations: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]; + + /** IngressTo resources. */ + public resources: string[]; + + /** + * Creates a new IngressTo instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressTo instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Encodes the specified IngressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @param message IngressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @param message IngressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressTo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Decodes an IngressTo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Verifies an IngressTo 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 IngressTo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressTo + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Creates a plain object from an IngressTo message. Also converts values to other types if specified. + * @param message IngressTo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressTo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressTo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressPolicy. */ + interface IIngressPolicy { + + /** IngressPolicy ingressFrom */ + ingressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null); + + /** IngressPolicy ingressTo */ + ingressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null); + } + + /** Represents an IngressPolicy. */ + class IngressPolicy implements IIngressPolicy { + + /** + * Constructs a new IngressPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy); + + /** IngressPolicy ingressFrom. */ + public ingressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null); + + /** IngressPolicy ingressTo. */ + public ingressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null); + + /** + * Creates a new IngressPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Encodes the specified IngressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @param message IngressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @param message IngressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Verifies an IngressPolicy 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 IngressPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Creates a plain object from an IngressPolicy message. Also converts values to other types if specified. + * @param message IngressPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressFrom. */ + interface IEgressFrom { + + /** EgressFrom identities */ + identities?: (string[]|null); + + /** EgressFrom identityType */ + identityType?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null); + } + + /** Represents an EgressFrom. */ + class EgressFrom implements IEgressFrom { + + /** + * Constructs a new EgressFrom. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom); + + /** EgressFrom identities. */ + public identities: string[]; + + /** EgressFrom identityType. */ + public identityType: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType); + + /** + * Creates a new EgressFrom instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressFrom instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Encodes the specified EgressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @param message EgressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @param message EgressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressFrom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Decodes an EgressFrom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Verifies an EgressFrom 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 EgressFrom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressFrom + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Creates a plain object from an EgressFrom message. Also converts values to other types if specified. + * @param message EgressFrom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressFrom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressFrom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressTo. */ + interface IEgressTo { + + /** EgressTo resources */ + resources?: (string[]|null); + + /** EgressTo operations */ + operations?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]|null); + + /** EgressTo externalResources */ + externalResources?: (string[]|null); + } + + /** Represents an EgressTo. */ + class EgressTo implements IEgressTo { + + /** + * Constructs a new EgressTo. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo); + + /** EgressTo resources. */ + public resources: string[]; + + /** EgressTo operations. */ + public operations: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]; + + /** EgressTo externalResources. */ + public externalResources: string[]; + + /** + * Creates a new EgressTo instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressTo instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Encodes the specified EgressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @param message EgressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @param message EgressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressTo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Decodes an EgressTo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Verifies an EgressTo 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 EgressTo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressTo + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Creates a plain object from an EgressTo message. Also converts values to other types if specified. + * @param message EgressTo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressTo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressTo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressPolicy. */ + interface IEgressPolicy { + + /** EgressPolicy egressFrom */ + egressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null); + + /** EgressPolicy egressTo */ + egressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null); + } + + /** Represents an EgressPolicy. */ + class EgressPolicy implements IEgressPolicy { + + /** + * Constructs a new EgressPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy); + + /** EgressPolicy egressFrom. */ + public egressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null); + + /** EgressPolicy egressTo. */ + public egressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null); + + /** + * Creates a new EgressPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Encodes the specified EgressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @param message EgressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @param message EgressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Verifies an EgressPolicy 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 EgressPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Creates a plain object from an EgressPolicy message. Also converts values to other types if specified. + * @param message EgressPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace type. */ + namespace type { + + /** DeviceEncryptionStatus enum. */ + enum DeviceEncryptionStatus { + ENCRYPTION_UNSPECIFIED = 0, + ENCRYPTION_UNSUPPORTED = 1, + UNENCRYPTED = 2, + ENCRYPTED = 3 + } + + /** OsType enum. */ + enum OsType { + OS_UNSPECIFIED = 0, + DESKTOP_MAC = 1, + DESKTOP_WINDOWS = 2, + DESKTOP_LINUX = 3, + DESKTOP_CHROME_OS = 6, + ANDROID = 4, + IOS = 5 + } + + /** DeviceManagementLevel enum. */ + enum DeviceManagementLevel { + MANAGEMENT_UNSPECIFIED = 0, + NONE = 1, + BASIC = 2, + COMPLETE = 3 + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.js new file mode 100644 index 00000000000..a9de0143e68 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.js @@ -0,0 +1,33540 @@ +// Copyright 2024 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_asset_protos || ($protobuf.roots._google_cloud_asset_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.asset = (function() { + + /** + * Namespace asset. + * @memberof google.cloud + * @namespace + */ + var asset = {}; + + asset.v1p2beta1 = (function() { + + /** + * Namespace v1p2beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p2beta1 = {}; + + v1p2beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p2beta1 + * @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.v1p2beta1.AssetService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AssetService} RPC service. Useful where requests and/or responses are streamed. + */ + AssetService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|createFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef CreateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.CreateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.createFeed = function createFeed(request, callback) { + return this.rpcCall(createFeed, $root.google.cloud.asset.v1p2beta1.CreateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "CreateFeed" }); + + /** + * Calls CreateFeed. + * @function createFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} request CreateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|getFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef GetFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.GetFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.getFeed = function getFeed(request, callback) { + return this.rpcCall(getFeed, $root.google.cloud.asset.v1p2beta1.GetFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "GetFeed" }); + + /** + * Calls GetFeed. + * @function getFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} request GetFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|listFeeds}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef ListFeedsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} [response] ListFeedsResponse + */ + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.ListFeedsCallback} callback Node-style callback called with the error, if any, and ListFeedsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listFeeds = function listFeeds(request, callback) { + return this.rpcCall(listFeeds, $root.google.cloud.asset.v1p2beta1.ListFeedsRequest, $root.google.cloud.asset.v1p2beta1.ListFeedsResponse, request, callback); + }, "name", { value: "ListFeeds" }); + + /** + * Calls ListFeeds. + * @function listFeeds + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} request ListFeedsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|updateFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef UpdateFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p2beta1.Feed} [response] Feed + */ + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.UpdateFeedCallback} callback Node-style callback called with the error, if any, and Feed + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.updateFeed = function updateFeed(request, callback) { + return this.rpcCall(updateFeed, $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest, $root.google.cloud.asset.v1p2beta1.Feed, request, callback); + }, "name", { value: "UpdateFeed" }); + + /** + * Calls UpdateFeed. + * @function updateFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} request UpdateFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.asset.v1p2beta1.AssetService|deleteFeed}. + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @typedef DeleteFeedCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @param {google.cloud.asset.v1p2beta1.AssetService.DeleteFeedCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.deleteFeed = function deleteFeed(request, callback) { + return this.rpcCall(deleteFeed, $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFeed" }); + + /** + * Calls DeleteFeed. + * @function deleteFeed + * @memberof google.cloud.asset.v1p2beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} request DeleteFeedRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p2beta1.ExportAssetsResponse = (function() { + + /** + * Properties of an ExportAssetsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IExportAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime + * @property {google.cloud.asset.v1p2beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + */ + + /** + * Constructs a new ExportAssetsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an ExportAssetsResponse. + * @implements IExportAssetsResponse + * @constructor + * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse=} [properties] Properties to set + */ + function ExportAssetsResponse(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]]; + } + + /** + * ExportAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.readTime = null; + + /** + * ExportAssetsResponse outputConfig. + * @member {google.cloud.asset.v1p2beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputConfig = null; + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse instance + */ + ExportAssetsResponse.create = function create(properties) { + return new ExportAssetsResponse(properties); + }; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1p2beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ExportAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p2beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.ExportAssetsResponse} ExportAssetsResponse + */ + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.fromObject(object.outputConfig); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.ExportAssetsResponse} message ExportAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readTime = null; + object.outputConfig = null; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p2beta1.OutputConfig.toObject(message.outputConfig, options); + return object; + }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.ExportAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.ExportAssetsResponse"; + }; + + return ExportAssetsResponse; + })(); + + v1p2beta1.BatchGetAssetsHistoryResponse = (function() { + + /** + * Properties of a BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IBatchGetAssetsHistoryResponse + * @property {Array.|null} [assets] BatchGetAssetsHistoryResponse assets + */ + + /** + * Constructs a new BatchGetAssetsHistoryResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a BatchGetAssetsHistoryResponse. + * @implements IBatchGetAssetsHistoryResponse + * @constructor + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + */ + function BatchGetAssetsHistoryResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * BatchGetAssetsHistoryResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @instance + */ + BatchGetAssetsHistoryResponse.prototype.assets = $util.emptyArray; + + /** + * Creates a new BatchGetAssetsHistoryResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse instance + */ + BatchGetAssetsHistoryResponse.create = function create(properties) { + return new BatchGetAssetsHistoryResponse(properties); + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1p2beta1.TemporalAsset.encode(message.assets[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchGetAssetsHistoryResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IBatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchGetAssetsHistoryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1p2beta1.TemporalAsset.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchGetAssetsHistoryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchGetAssetsHistoryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchGetAssetsHistoryResponse message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchGetAssetsHistoryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1p2beta1.TemporalAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a BatchGetAssetsHistoryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} BatchGetAssetsHistoryResponse + */ + BatchGetAssetsHistoryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse(); + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1p2beta1.TemporalAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchGetAssetsHistoryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse} message BatchGetAssetsHistoryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchGetAssetsHistoryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1p2beta1.TemporalAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this BatchGetAssetsHistoryResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @instance + * @returns {Object.} JSON object + */ + BatchGetAssetsHistoryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchGetAssetsHistoryResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchGetAssetsHistoryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.BatchGetAssetsHistoryResponse"; + }; + + return BatchGetAssetsHistoryResponse; + })(); + + v1p2beta1.CreateFeedRequest = (function() { + + /** + * Properties of a CreateFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface ICreateFeedRequest + * @property {string|null} [parent] CreateFeedRequest parent + * @property {string|null} [feedId] CreateFeedRequest feedId + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] CreateFeedRequest feed + */ + + /** + * Constructs a new CreateFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a CreateFeedRequest. + * @implements ICreateFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + */ + function CreateFeedRequest(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]]; + } + + /** + * CreateFeedRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.parent = ""; + + /** + * CreateFeedRequest feedId. + * @member {string} feedId + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feedId = ""; + + /** + * CreateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + */ + CreateFeedRequest.prototype.feed = null; + + /** + * Creates a new CreateFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest instance + */ + CreateFeedRequest.create = function create(properties) { + return new CreateFeedRequest(properties); + }; + + /** + * Encodes the specified CreateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.feedId != null && Object.hasOwnProperty.call(message, "feedId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.feedId); + if (message.feed != null && Object.hasOwnProperty.call(message, "feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.CreateFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ICreateFeedRequest} message CreateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFeedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.feedId = reader.string(); + break; + } + case 3: { + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.feedId != null && message.hasOwnProperty("feedId")) + if (!$util.isString(message.feedId)) + return "feedId: string expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } + return null; + }; + + /** + * Creates a CreateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.CreateFeedRequest} CreateFeedRequest + */ + CreateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.CreateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.CreateFeedRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.feedId != null) + message.feedId = String(object.feedId); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.CreateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + } + return message; + }; + + /** + * Creates a plain object from a CreateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.CreateFeedRequest} message CreateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.feedId = ""; + object.feed = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.feedId != null && message.hasOwnProperty("feedId")) + object.feedId = message.feedId; + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + return object; + }; + + /** + * Converts this CreateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.CreateFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.CreateFeedRequest"; + }; + + return CreateFeedRequest; + })(); + + v1p2beta1.GetFeedRequest = (function() { + + /** + * Properties of a GetFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IGetFeedRequest + * @property {string|null} [name] GetFeedRequest name + */ + + /** + * Constructs a new GetFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a GetFeedRequest. + * @implements IGetFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + */ + function GetFeedRequest(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]]; + } + + /** + * GetFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @instance + */ + GetFeedRequest.prototype.name = ""; + + /** + * Creates a new GetFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest instance + */ + GetFeedRequest.create = function create(properties) { + return new GetFeedRequest(properties); + }; + + /** + * Encodes the specified GetFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.GetFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IGetFeedRequest} message GetFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFeedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.GetFeedRequest} GetFeedRequest + */ + GetFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GetFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.GetFeedRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.GetFeedRequest} message GetFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @instance + * @returns {Object.} JSON object + */ + GetFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.GetFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.GetFeedRequest"; + }; + + return GetFeedRequest; + })(); + + v1p2beta1.ListFeedsRequest = (function() { + + /** + * Properties of a ListFeedsRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IListFeedsRequest + * @property {string|null} [parent] ListFeedsRequest parent + */ + + /** + * Constructs a new ListFeedsRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a ListFeedsRequest. + * @implements IListFeedsRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + */ + function ListFeedsRequest(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]]; + } + + /** + * ListFeedsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @instance + */ + ListFeedsRequest.prototype.parent = ""; + + /** + * Creates a new ListFeedsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest instance + */ + ListFeedsRequest.create = function create(properties) { + return new ListFeedsRequest(properties); + }; + + /** + * Encodes the specified ListFeedsRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified ListFeedsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsRequest} message ListFeedsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFeedsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFeedsRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFeedsRequest.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"; + return null; + }; + + /** + * Creates a ListFeedsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.ListFeedsRequest} ListFeedsRequest + */ + ListFeedsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListFeedsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {google.cloud.asset.v1p2beta1.ListFeedsRequest} message ListFeedsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFeedsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListFeedsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @instance + * @returns {Object.} JSON object + */ + ListFeedsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFeedsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.ListFeedsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFeedsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.ListFeedsRequest"; + }; + + return ListFeedsRequest; + })(); + + v1p2beta1.ListFeedsResponse = (function() { + + /** + * Properties of a ListFeedsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IListFeedsResponse + * @property {Array.|null} [feeds] ListFeedsResponse feeds + */ + + /** + * Constructs a new ListFeedsResponse. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a ListFeedsResponse. + * @implements IListFeedsResponse + * @constructor + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + */ + function ListFeedsResponse(properties) { + this.feeds = []; + 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]]; + } + + /** + * ListFeedsResponse feeds. + * @member {Array.} feeds + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @instance + */ + ListFeedsResponse.prototype.feeds = $util.emptyArray; + + /** + * Creates a new ListFeedsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse instance + */ + ListFeedsResponse.create = function create(properties) { + return new ListFeedsResponse(properties); + }; + + /** + * Encodes the specified ListFeedsResponse message. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feeds != null && message.feeds.length) + for (var i = 0; i < message.feeds.length; ++i) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListFeedsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.ListFeedsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.IListFeedsResponse} message ListFeedsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFeedsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.feeds && message.feeds.length)) + message.feeds = []; + message.feeds.push($root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFeedsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFeedsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFeedsResponse message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFeedsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feeds != null && message.hasOwnProperty("feeds")) { + if (!Array.isArray(message.feeds)) + return "feeds: array expected"; + for (var i = 0; i < message.feeds.length; ++i) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feeds[i]); + if (error) + return "feeds." + error; + } + } + return null; + }; + + /** + * Creates a ListFeedsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.ListFeedsResponse} ListFeedsResponse + */ + ListFeedsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.ListFeedsResponse) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.ListFeedsResponse(); + if (object.feeds) { + if (!Array.isArray(object.feeds)) + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: array expected"); + message.feeds = []; + for (var i = 0; i < object.feeds.length; ++i) { + if (typeof object.feeds[i] !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.ListFeedsResponse.feeds: object expected"); + message.feeds[i] = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feeds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListFeedsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {google.cloud.asset.v1p2beta1.ListFeedsResponse} message ListFeedsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFeedsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.feeds = []; + if (message.feeds && message.feeds.length) { + object.feeds = []; + for (var j = 0; j < message.feeds.length; ++j) + object.feeds[j] = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feeds[j], options); + } + return object; + }; + + /** + * Converts this ListFeedsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @instance + * @returns {Object.} JSON object + */ + ListFeedsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFeedsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.ListFeedsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFeedsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.ListFeedsResponse"; + }; + + return ListFeedsResponse; + })(); + + v1p2beta1.UpdateFeedRequest = (function() { + + /** + * Properties of an UpdateFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IUpdateFeedRequest + * @property {google.cloud.asset.v1p2beta1.IFeed|null} [feed] UpdateFeedRequest feed + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeedRequest updateMask + */ + + /** + * Constructs a new UpdateFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an UpdateFeedRequest. + * @implements IUpdateFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + */ + function UpdateFeedRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFeedRequest feed. + * @member {google.cloud.asset.v1p2beta1.IFeed|null|undefined} feed + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.feed = null; + + /** + * UpdateFeedRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @instance + */ + UpdateFeedRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest instance + */ + UpdateFeedRequest.create = function create(properties) { + return new UpdateFeedRequest(properties); + }; + + /** + * Encodes the specified UpdateFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.feed != null && Object.hasOwnProperty.call(message, "feed")) + $root.google.cloud.asset.v1p2beta1.Feed.encode(message.feed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.UpdateFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IUpdateFeedRequest} message UpdateFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.feed != null && message.hasOwnProperty("feed")) { + var error = $root.google.cloud.asset.v1p2beta1.Feed.verify(message.feed); + if (error) + return "feed." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.UpdateFeedRequest} UpdateFeedRequest + */ + UpdateFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.UpdateFeedRequest(); + if (object.feed != null) { + if (typeof object.feed !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.feed: object expected"); + message.feed = $root.google.cloud.asset.v1p2beta1.Feed.fromObject(object.feed); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.UpdateFeedRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.UpdateFeedRequest} message UpdateFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.feed = null; + object.updateMask = null; + } + if (message.feed != null && message.hasOwnProperty("feed")) + object.feed = $root.google.cloud.asset.v1p2beta1.Feed.toObject(message.feed, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.UpdateFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.UpdateFeedRequest"; + }; + + return UpdateFeedRequest; + })(); + + v1p2beta1.DeleteFeedRequest = (function() { + + /** + * Properties of a DeleteFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IDeleteFeedRequest + * @property {string|null} [name] DeleteFeedRequest name + */ + + /** + * Constructs a new DeleteFeedRequest. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a DeleteFeedRequest. + * @implements IDeleteFeedRequest + * @constructor + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + */ + function DeleteFeedRequest(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]]; + } + + /** + * DeleteFeedRequest name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @instance + */ + DeleteFeedRequest.prototype.name = ""; + + /** + * Creates a new DeleteFeedRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest instance + */ + DeleteFeedRequest.create = function create(properties) { + return new DeleteFeedRequest(properties); + }; + + /** + * Encodes the specified DeleteFeedRequest message. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFeedRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteFeedRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.DeleteFeedRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.IDeleteFeedRequest} message DeleteFeedRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFeedRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFeedRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteFeedRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFeedRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFeedRequest message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFeedRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteFeedRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.DeleteFeedRequest} DeleteFeedRequest + */ + DeleteFeedRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.DeleteFeedRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteFeedRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {google.cloud.asset.v1p2beta1.DeleteFeedRequest} message DeleteFeedRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFeedRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteFeedRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFeedRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFeedRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.DeleteFeedRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFeedRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.DeleteFeedRequest"; + }; + + return DeleteFeedRequest; + })(); + + v1p2beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IOutputConfig + * @property {google.cloud.asset.v1p2beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(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]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1p2beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.asset.v1p2beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.OutputConfig) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1p2beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1p2beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1p2beta1.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|null|undefined} uri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcsDestination objectUri. + * @member {"uri"|undefined} objectUri + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "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.v1p2beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IGcsDestination} message GcsDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + 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.v1p2beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.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.v1p2beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.v1p2beta1.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"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p2beta1.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 (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; + } + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.GcsDestination"; + }; + + return GcsDestination; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1p2beta1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + */ + v1p2beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + return values; + })(); + + v1p2beta1.PubsubDestination = (function() { + + /** + * Properties of a PubsubDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IPubsubDestination + * @property {string|null} [topic] PubsubDestination topic + */ + + /** + * Constructs a new PubsubDestination. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a PubsubDestination. + * @implements IPubsubDestination + * @constructor + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + */ + function PubsubDestination(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]]; + } + + /** + * PubsubDestination topic. + * @member {string} topic + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @instance + */ + PubsubDestination.prototype.topic = ""; + + /** + * Creates a new PubsubDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination instance + */ + PubsubDestination.create = function create(properties) { + return new PubsubDestination(properties); + }; + + /** + * Encodes the specified PubsubDestination message. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + return writer; + }; + + /** + * Encodes the specified PubsubDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.PubsubDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {google.cloud.asset.v1p2beta1.IPubsubDestination} message PubsubDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PubsubDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topic = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PubsubDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PubsubDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PubsubDestination message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PubsubDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + return null; + }; + + /** + * Creates a PubsubDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.PubsubDestination} PubsubDestination + */ + PubsubDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.PubsubDestination) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.PubsubDestination(); + if (object.topic != null) + message.topic = String(object.topic); + return message; + }; + + /** + * Creates a plain object from a PubsubDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {google.cloud.asset.v1p2beta1.PubsubDestination} message PubsubDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PubsubDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.topic = ""; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + return object; + }; + + /** + * Converts this PubsubDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @instance + * @returns {Object.} JSON object + */ + PubsubDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PubsubDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.PubsubDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PubsubDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.PubsubDestination"; + }; + + return PubsubDestination; + })(); + + v1p2beta1.FeedOutputConfig = (function() { + + /** + * Properties of a FeedOutputConfig. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IFeedOutputConfig + * @property {google.cloud.asset.v1p2beta1.IPubsubDestination|null} [pubsubDestination] FeedOutputConfig pubsubDestination + */ + + /** + * Constructs a new FeedOutputConfig. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a FeedOutputConfig. + * @implements IFeedOutputConfig + * @constructor + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + */ + function FeedOutputConfig(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]]; + } + + /** + * FeedOutputConfig pubsubDestination. + * @member {google.cloud.asset.v1p2beta1.IPubsubDestination|null|undefined} pubsubDestination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @instance + */ + FeedOutputConfig.prototype.pubsubDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FeedOutputConfig destination. + * @member {"pubsubDestination"|undefined} destination + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @instance + */ + Object.defineProperty(FeedOutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["pubsubDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeedOutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig instance + */ + FeedOutputConfig.create = function create(properties) { + return new FeedOutputConfig(properties); + }; + + /** + * Encodes the specified FeedOutputConfig message. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeedOutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pubsubDestination != null && Object.hasOwnProperty.call(message, "pubsubDestination")) + $root.google.cloud.asset.v1p2beta1.PubsubDestination.encode(message.pubsubDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeedOutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.FeedOutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.IFeedOutputConfig} message FeedOutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeedOutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeedOutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeedOutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeedOutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeedOutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeedOutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p2beta1.PubsubDestination.verify(message.pubsubDestination); + if (error) + return "pubsubDestination." + error; + } + } + return null; + }; + + /** + * Creates a FeedOutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.FeedOutputConfig} FeedOutputConfig + */ + FeedOutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.FeedOutputConfig) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.FeedOutputConfig(); + if (object.pubsubDestination != null) { + if (typeof object.pubsubDestination !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.FeedOutputConfig.pubsubDestination: object expected"); + message.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.fromObject(object.pubsubDestination); + } + return message; + }; + + /** + * Creates a plain object from a FeedOutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {google.cloud.asset.v1p2beta1.FeedOutputConfig} message FeedOutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeedOutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.pubsubDestination != null && message.hasOwnProperty("pubsubDestination")) { + object.pubsubDestination = $root.google.cloud.asset.v1p2beta1.PubsubDestination.toObject(message.pubsubDestination, options); + if (options.oneofs) + object.destination = "pubsubDestination"; + } + return object; + }; + + /** + * Converts this FeedOutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @instance + * @returns {Object.} JSON object + */ + FeedOutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeedOutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.FeedOutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeedOutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.FeedOutputConfig"; + }; + + return FeedOutputConfig; + })(); + + v1p2beta1.Feed = (function() { + + /** + * Properties of a Feed. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IFeed + * @property {string|null} [name] Feed name + * @property {Array.|null} [assetNames] Feed assetNames + * @property {Array.|null} [assetTypes] Feed assetTypes + * @property {google.cloud.asset.v1p2beta1.ContentType|null} [contentType] Feed contentType + * @property {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig + */ + + /** + * Constructs a new Feed. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a Feed. + * @implements IFeed + * @constructor + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + */ + function Feed(properties) { + this.assetNames = []; + this.assetTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Feed name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.name = ""; + + /** + * Feed assetNames. + * @member {Array.} assetNames + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.assetNames = $util.emptyArray; + + /** + * Feed assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.assetTypes = $util.emptyArray; + + /** + * Feed contentType. + * @member {google.cloud.asset.v1p2beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.contentType = 0; + + /** + * Feed feedOutputConfig. + * @member {google.cloud.asset.v1p2beta1.IFeedOutputConfig|null|undefined} feedOutputConfig + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + */ + Feed.prototype.feedOutputConfig = null; + + /** + * Creates a new Feed instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {google.cloud.asset.v1p2beta1.IFeed=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed instance + */ + Feed.create = function create(properties) { + return new Feed(properties); + }; + + /** + * Encodes the specified Feed message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetNames != null && message.assetNames.length) + for (var i = 0; i < message.assetNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetNames[i]); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.feedOutputConfig != null && Object.hasOwnProperty.call(message, "feedOutputConfig")) + $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Feed message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Feed.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {google.cloud.asset.v1p2beta1.IFeed} message Feed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Feed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Feed message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feed.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Feed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.assetNames && message.assetNames.length)) + message.assetNames = []; + message.assetNames.push(reader.string()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Feed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Feed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Feed message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Feed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetNames != null && message.hasOwnProperty("assetNames")) { + if (!Array.isArray(message.assetNames)) + return "assetNames: array expected"; + for (var i = 0; i < message.assetNames.length; ++i) + if (!$util.isString(message.assetNames[i])) + return "assetNames: string[] expected"; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { + var error = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.verify(message.feedOutputConfig); + if (error) + return "feedOutputConfig." + error; + } + return null; + }; + + /** + * Creates a Feed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.Feed} Feed + */ + Feed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Feed) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.Feed(); + if (object.name != null) + message.name = String(object.name); + if (object.assetNames) { + if (!Array.isArray(object.assetNames)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetNames: array expected"); + message.assetNames = []; + for (var i = 0; i < object.assetNames.length; ++i) + message.assetNames[i] = String(object.assetNames[i]); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + } + if (object.feedOutputConfig != null) { + if (typeof object.feedOutputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Feed.feedOutputConfig: object expected"); + message.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.fromObject(object.feedOutputConfig); + } + return message; + }; + + /** + * Creates a plain object from a Feed message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {google.cloud.asset.v1p2beta1.Feed} message Feed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Feed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.assetNames = []; + object.assetTypes = []; + } + if (options.defaults) { + object.name = ""; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.feedOutputConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetNames && message.assetNames.length) { + object.assetNames = []; + for (var j = 0; j < message.assetNames.length; ++j) + object.assetNames[j] = message.assetNames[j]; + } + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1p2beta1.ContentType[message.contentType] : message.contentType; + if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) + object.feedOutputConfig = $root.google.cloud.asset.v1p2beta1.FeedOutputConfig.toObject(message.feedOutputConfig, options); + return object; + }; + + /** + * Converts this Feed to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.Feed + * @instance + * @returns {Object.} JSON object + */ + Feed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Feed + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.Feed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Feed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.Feed"; + }; + + return Feed; + })(); + + v1p2beta1.TemporalAsset = (function() { + + /** + * Properties of a TemporalAsset. + * @memberof google.cloud.asset.v1p2beta1 + * @interface ITemporalAsset + * @property {google.cloud.asset.v1p2beta1.ITimeWindow|null} [window] TemporalAsset window + * @property {boolean|null} [deleted] TemporalAsset deleted + * @property {google.cloud.asset.v1p2beta1.IAsset|null} [asset] TemporalAsset asset + */ + + /** + * Constructs a new TemporalAsset. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a TemporalAsset. + * @implements ITemporalAsset + * @constructor + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + */ + function TemporalAsset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TemporalAsset window. + * @member {google.cloud.asset.v1p2beta1.ITimeWindow|null|undefined} window + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.window = null; + + /** + * TemporalAsset deleted. + * @member {boolean} deleted + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.deleted = false; + + /** + * TemporalAsset asset. + * @member {google.cloud.asset.v1p2beta1.IAsset|null|undefined} asset + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + */ + TemporalAsset.prototype.asset = null; + + /** + * Creates a new TemporalAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset instance + */ + TemporalAsset.create = function create(properties) { + return new TemporalAsset(properties); + }; + + /** + * Encodes the specified TemporalAsset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.window != null && Object.hasOwnProperty.call(message, "window")) + $root.google.cloud.asset.v1p2beta1.TimeWindow.encode(message.window, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.deleted); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + $root.google.cloud.asset.v1p2beta1.Asset.encode(message.asset, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TemporalAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TemporalAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1p2beta1.ITemporalAsset} message TemporalAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TemporalAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deleted = reader.bool(); + break; + } + case 3: { + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TemporalAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TemporalAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TemporalAsset message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TemporalAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.window != null && message.hasOwnProperty("window")) { + var error = $root.google.cloud.asset.v1p2beta1.TimeWindow.verify(message.window); + if (error) + return "window." + error; + } + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + if (message.asset != null && message.hasOwnProperty("asset")) { + var error = $root.google.cloud.asset.v1p2beta1.Asset.verify(message.asset); + if (error) + return "asset." + error; + } + return null; + }; + + /** + * Creates a TemporalAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.TemporalAsset} TemporalAsset + */ + TemporalAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TemporalAsset) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.TemporalAsset(); + if (object.window != null) { + if (typeof object.window !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.window: object expected"); + message.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.fromObject(object.window); + } + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + if (object.asset != null) { + if (typeof object.asset !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TemporalAsset.asset: object expected"); + message.asset = $root.google.cloud.asset.v1p2beta1.Asset.fromObject(object.asset); + } + return message; + }; + + /** + * Creates a plain object from a TemporalAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {google.cloud.asset.v1p2beta1.TemporalAsset} message TemporalAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TemporalAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.window = null; + object.deleted = false; + object.asset = null; + } + if (message.window != null && message.hasOwnProperty("window")) + object.window = $root.google.cloud.asset.v1p2beta1.TimeWindow.toObject(message.window, options); + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = $root.google.cloud.asset.v1p2beta1.Asset.toObject(message.asset, options); + return object; + }; + + /** + * Converts this TemporalAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @instance + * @returns {Object.} JSON object + */ + TemporalAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TemporalAsset + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.TemporalAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TemporalAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.TemporalAsset"; + }; + + return TemporalAsset; + })(); + + v1p2beta1.TimeWindow = (function() { + + /** + * Properties of a TimeWindow. + * @memberof google.cloud.asset.v1p2beta1 + * @interface ITimeWindow + * @property {google.protobuf.ITimestamp|null} [startTime] TimeWindow startTime + * @property {google.protobuf.ITimestamp|null} [endTime] TimeWindow endTime + */ + + /** + * Constructs a new TimeWindow. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a TimeWindow. + * @implements ITimeWindow + * @constructor + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + */ + function TimeWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeWindow startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.startTime = null; + + /** + * TimeWindow endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @instance + */ + TimeWindow.prototype.endTime = null; + + /** + * Creates a new TimeWindow instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1p2beta1.ITimeWindow=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow instance + */ + TimeWindow.create = function create(properties) { + return new TimeWindow(properties); + }; + + /** + * Encodes the specified TimeWindow message. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeWindow message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.TimeWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1p2beta1.ITimeWindow} message TimeWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeWindow message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; + + /** + * Creates a TimeWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.TimeWindow} TimeWindow + */ + TimeWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.TimeWindow) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.TimeWindow(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TimeWindow.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.TimeWindow.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a TimeWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {google.cloud.asset.v1p2beta1.TimeWindow} message TimeWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + return object; + }; + + /** + * Converts this TimeWindow to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @instance + * @returns {Object.} JSON object + */ + TimeWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeWindow + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.TimeWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.TimeWindow"; + }; + + return TimeWindow; + })(); + + v1p2beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1p2beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [ancestors] Asset ancestors + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {Array.|null} [orgPolicy] Asset orgPolicy + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.ancestors = []; + this.orgPolicy = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1p2beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {google.cloud.asset.v1p2beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1p2beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.ancestors[i]); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {google.cloud.asset.v1p2beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p2beta1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } + case 7: { + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + } + case 9: { + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1p2beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Asset) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1p2beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {google.cloud.asset.v1p2beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ancestors = []; + object.orgPolicy = []; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1p2beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.Asset"; + }; + + return Asset; + })(); + + v1p2beta1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1p2beta1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1p2beta1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {google.cloud.asset.v1p2beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p2beta1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {google.cloud.asset.v1p2beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + 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.v1p2beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p2beta1.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.v1p2beta1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.discoveryDocumentUri = reader.string(); + break; + } + case 3: { + message.discoveryName = reader.string(); + break; + } + case 4: { + message.resourceUrl = reader.string(); + break; + } + case 5: { + message.parent = reader.string(); + break; + } + case 6: { + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.v1p2beta1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p2beta1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p2beta1.Resource) + return object; + var message = new $root.google.cloud.asset.v1p2beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1p2beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {google.cloud.asset.v1p2beta1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p2beta1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1p2beta1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p2beta1.Resource"; + }; + + return Resource; + })(); + + return v1p2beta1; + })(); + + return asset; + })(); + + cloud.orgpolicy = (function() { + + /** + * Namespace orgpolicy. + * @memberof google.cloud + * @namespace + */ + var orgpolicy = {}; + + orgpolicy.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.orgpolicy + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.cloud.orgpolicy.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {string|null} [constraint] Policy constraint + * @property {Uint8Array|null} [etag] Policy etag + * @property {google.protobuf.ITimestamp|null} [updateTime] Policy updateTime + * @property {google.cloud.orgpolicy.v1.Policy.IListPolicy|null} [listPolicy] Policy listPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null} [booleanPolicy] Policy booleanPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null} [restoreDefault] Policy restoreDefault + */ + + /** + * Constructs a new Policy. + * @memberof google.cloud.orgpolicy.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + */ + function Policy(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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy constraint. + * @member {string} constraint + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.constraint = ""; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Policy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.updateTime = null; + + /** + * Policy listPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IListPolicy|null|undefined} listPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.listPolicy = null; + + /** + * Policy booleanPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null|undefined} booleanPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.booleanPolicy = null; + + /** + * Policy restoreDefault. + * @member {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null|undefined} restoreDefault + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.restoreDefault = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Policy policyType. + * @member {"listPolicy"|"booleanPolicy"|"restoreDefault"|undefined} policyType + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Object.defineProperty(Policy.prototype, "policyType", { + get: $util.oneOfGetter($oneOfFields = ["listPolicy", "booleanPolicy", "restoreDefault"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.listPolicy != null && Object.hasOwnProperty.call(message, "listPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.encode(message.listPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.booleanPolicy != null && Object.hasOwnProperty.call(message, "booleanPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.encode(message.booleanPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.restoreDefault != null && Object.hasOwnProperty.call(message, "restoreDefault")) + $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.encode(message.restoreDefault, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.orgpolicy.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + message.constraint = reader.string(); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.decode(reader, reader.uint32()); + break; + } + case 6: { + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.decode(reader, reader.uint32()); + break; + } + case 7: { + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isString(message.constraint)) + return "constraint: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.verify(message.listPolicy); + if (error) + return "listPolicy." + error; + } + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify(message.booleanPolicy); + if (error) + return "booleanPolicy." + error; + } + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify(message.restoreDefault); + if (error) + return "restoreDefault." + error; + } + } + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.constraint != null) + message.constraint = String(object.constraint); + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.listPolicy != null) { + if (typeof object.listPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.listPolicy: object expected"); + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.fromObject(object.listPolicy); + } + if (object.booleanPolicy != null) { + if (typeof object.booleanPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.booleanPolicy: object expected"); + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.fromObject(object.booleanPolicy); + } + if (object.restoreDefault != null) { + if (typeof object.restoreDefault !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.restoreDefault: object expected"); + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.fromObject(object.restoreDefault); + } + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = 0; + object.constraint = ""; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + object.updateTime = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + object.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.toObject(message.listPolicy, options); + if (options.oneofs) + object.policyType = "listPolicy"; + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + object.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.toObject(message.booleanPolicy, options); + if (options.oneofs) + object.policyType = "booleanPolicy"; + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + object.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.toObject(message.restoreDefault, options); + if (options.oneofs) + object.policyType = "restoreDefault"; + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy"; + }; + + Policy.ListPolicy = (function() { + + /** + * Properties of a ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IListPolicy + * @property {Array.|null} [allowedValues] ListPolicy allowedValues + * @property {Array.|null} [deniedValues] ListPolicy deniedValues + * @property {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null} [allValues] ListPolicy allValues + * @property {string|null} [suggestedValue] ListPolicy suggestedValue + * @property {boolean|null} [inheritFromParent] ListPolicy inheritFromParent + */ + + /** + * Constructs a new ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a ListPolicy. + * @implements IListPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + */ + function ListPolicy(properties) { + this.allowedValues = []; + this.deniedValues = []; + 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]]; + } + + /** + * ListPolicy allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allowedValues = $util.emptyArray; + + /** + * ListPolicy deniedValues. + * @member {Array.} deniedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.deniedValues = $util.emptyArray; + + /** + * ListPolicy allValues. + * @member {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues} allValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allValues = 0; + + /** + * ListPolicy suggestedValue. + * @member {string} suggestedValue + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.suggestedValue = ""; + + /** + * ListPolicy inheritFromParent. + * @member {boolean} inheritFromParent + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.inheritFromParent = false; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy instance + */ + ListPolicy.create = function create(properties) { + return new ListPolicy(properties); + }; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + if (message.deniedValues != null && message.deniedValues.length) + for (var i = 0; i < message.deniedValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedValues[i]); + if (message.allValues != null && Object.hasOwnProperty.call(message, "allValues")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.allValues); + if (message.suggestedValue != null && Object.hasOwnProperty.call(message, "suggestedValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.suggestedValue); + if (message.inheritFromParent != null && Object.hasOwnProperty.call(message, "inheritFromParent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inheritFromParent); + return writer; + }; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.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.orgpolicy.v1.Policy.ListPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + case 2: { + if (!(message.deniedValues && message.deniedValues.length)) + message.deniedValues = []; + message.deniedValues.push(reader.string()); + break; + } + case 3: { + message.allValues = reader.int32(); + break; + } + case 4: { + message.suggestedValue = reader.string(); + break; + } + case 5: { + message.inheritFromParent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + if (message.deniedValues != null && message.hasOwnProperty("deniedValues")) { + if (!Array.isArray(message.deniedValues)) + return "deniedValues: array expected"; + for (var i = 0; i < message.deniedValues.length; ++i) + if (!$util.isString(message.deniedValues[i])) + return "deniedValues: string[] expected"; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + switch (message.allValues) { + default: + return "allValues: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + if (!$util.isString(message.suggestedValue)) + return "suggestedValue: string expected"; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + if (typeof message.inheritFromParent !== "boolean") + return "inheritFromParent: boolean expected"; + return null; + }; + + /** + * Creates a ListPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + */ + ListPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.ListPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.ListPolicy(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + if (object.deniedValues) { + if (!Array.isArray(object.deniedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.deniedValues: array expected"); + message.deniedValues = []; + for (var i = 0; i < object.deniedValues.length; ++i) + message.deniedValues[i] = String(object.deniedValues[i]); + } + switch (object.allValues) { + default: + if (typeof object.allValues === "number") { + message.allValues = object.allValues; + break; + } + break; + case "ALL_VALUES_UNSPECIFIED": + case 0: + message.allValues = 0; + break; + case "ALLOW": + case 1: + message.allValues = 1; + break; + case "DENY": + case 2: + message.allValues = 2; + break; + } + if (object.suggestedValue != null) + message.suggestedValue = String(object.suggestedValue); + if (object.inheritFromParent != null) + message.inheritFromParent = Boolean(object.inheritFromParent); + return message; + }; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.ListPolicy} message ListPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedValues = []; + object.deniedValues = []; + } + if (options.defaults) { + object.allValues = options.enums === String ? "ALL_VALUES_UNSPECIFIED" : 0; + object.suggestedValue = ""; + object.inheritFromParent = false; + } + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + if (message.deniedValues && message.deniedValues.length) { + object.deniedValues = []; + for (var j = 0; j < message.deniedValues.length; ++j) + object.deniedValues[j] = message.deniedValues[j]; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + object.allValues = options.enums === String ? $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] === undefined ? message.allValues : $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] : message.allValues; + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + object.suggestedValue = message.suggestedValue; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + object.inheritFromParent = message.inheritFromParent; + return object; + }; + + /** + * Converts this ListPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + * @returns {Object.} JSON object + */ + ListPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.ListPolicy"; + }; + + /** + * AllValues enum. + * @name google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues + * @enum {number} + * @property {number} ALL_VALUES_UNSPECIFIED=0 ALL_VALUES_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + ListPolicy.AllValues = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALL_VALUES_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return ListPolicy; + })(); + + Policy.BooleanPolicy = (function() { + + /** + * Properties of a BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IBooleanPolicy + * @property {boolean|null} [enforced] BooleanPolicy enforced + */ + + /** + * Constructs a new BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a BooleanPolicy. + * @implements IBooleanPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + */ + function BooleanPolicy(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]]; + } + + /** + * BooleanPolicy enforced. + * @member {boolean} enforced + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + */ + BooleanPolicy.prototype.enforced = false; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy instance + */ + BooleanPolicy.create = function create(properties) { + return new BooleanPolicy(properties); + }; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enforced != null && Object.hasOwnProperty.call(message, "enforced")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enforced); + return writer; + }; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.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.orgpolicy.v1.Policy.BooleanPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enforced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BooleanPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BooleanPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforced != null && message.hasOwnProperty("enforced")) + if (typeof message.enforced !== "boolean") + return "enforced: boolean expected"; + return null; + }; + + /** + * Creates a BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + */ + BooleanPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy(); + if (object.enforced != null) + message.enforced = Boolean(object.enforced); + return message; + }; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} message BooleanPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BooleanPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enforced = false; + if (message.enforced != null && message.hasOwnProperty("enforced")) + object.enforced = message.enforced; + return object; + }; + + /** + * Converts this BooleanPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + * @returns {Object.} JSON object + */ + BooleanPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BooleanPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BooleanPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.BooleanPolicy"; + }; + + return BooleanPolicy; + })(); + + Policy.RestoreDefault = (function() { + + /** + * Properties of a RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IRestoreDefault + */ + + /** + * Constructs a new RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a RestoreDefault. + * @implements IRestoreDefault + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + */ + function RestoreDefault(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]]; + } + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault instance + */ + RestoreDefault.create = function create(properties) { + return new RestoreDefault(properties); + }; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.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.orgpolicy.v1.Policy.RestoreDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDefault message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + */ + RestoreDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault) + return object; + return new $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault(); + }; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.RestoreDefault} message RestoreDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDefault.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestoreDefault to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @instance + * @returns {Object.} JSON object + */ + RestoreDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDefault + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.RestoreDefault"; + }; + + return RestoreDefault; + })(); + + return Policy; + })(); + + return v1; + })(); + + return orgpolicy; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + 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]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + 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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + 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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + 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]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.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.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + 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]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + 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]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + 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]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(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]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + 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]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + 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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + 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]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.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.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.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.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + 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]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.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.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.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.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.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.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.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.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.identity = (function() { + + /** + * Namespace identity. + * @memberof google + * @namespace + */ + var identity = {}; + + identity.accesscontextmanager = (function() { + + /** + * Namespace accesscontextmanager. + * @memberof google.identity + * @namespace + */ + var accesscontextmanager = {}; + + accesscontextmanager.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var v1 = {}; + + v1.AccessLevel = (function() { + + /** + * Properties of an AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessLevel + * @property {string|null} [name] AccessLevel name + * @property {string|null} [title] AccessLevel title + * @property {string|null} [description] AccessLevel description + * @property {google.identity.accesscontextmanager.v1.IBasicLevel|null} [basic] AccessLevel basic + * @property {google.identity.accesscontextmanager.v1.ICustomLevel|null} [custom] AccessLevel custom + * @property {google.protobuf.ITimestamp|null} [createTime] AccessLevel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessLevel updateTime + */ + + /** + * Constructs a new AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessLevel. + * @implements IAccessLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + */ + function AccessLevel(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]]; + } + + /** + * AccessLevel name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.name = ""; + + /** + * AccessLevel title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.title = ""; + + /** + * AccessLevel description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.description = ""; + + /** + * AccessLevel basic. + * @member {google.identity.accesscontextmanager.v1.IBasicLevel|null|undefined} basic + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.basic = null; + + /** + * AccessLevel custom. + * @member {google.identity.accesscontextmanager.v1.ICustomLevel|null|undefined} custom + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.custom = null; + + /** + * AccessLevel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.createTime = null; + + /** + * AccessLevel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessLevel level. + * @member {"basic"|"custom"|undefined} level + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + Object.defineProperty(AccessLevel.prototype, "level", { + get: $util.oneOfGetter($oneOfFields = ["basic", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel instance + */ + AccessLevel.create = function create(properties) { + return new AccessLevel(properties); + }; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.basic != null && Object.hasOwnProperty.call(message, "basic")) + $root.google.identity.accesscontextmanager.v1.BasicLevel.encode(message.basic, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.identity.accesscontextmanager.v1.CustomLevel.encode(message.custom, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.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.identity.accesscontextmanager.v1.AccessLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.decode(reader, reader.uint32()); + break; + } + case 5: { + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.basic != null && message.hasOwnProperty("basic")) { + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.BasicLevel.verify(message.basic); + if (error) + return "basic." + error; + } + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.level === 1) + return "level: multiple values"; + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.CustomLevel.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an AccessLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + */ + AccessLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessLevel(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.basic != null) { + if (typeof object.basic !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.basic: object expected"); + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.fromObject(object.basic); + } + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.custom: object expected"); + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.fromObject(object.custom); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.AccessLevel} message AccessLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.basic != null && message.hasOwnProperty("basic")) { + object.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.toObject(message.basic, options); + if (options.oneofs) + object.level = "basic"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.toObject(message.custom, options); + if (options.oneofs) + object.level = "custom"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this AccessLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + * @returns {Object.} JSON object + */ + AccessLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessLevel"; + }; + + return AccessLevel; + })(); + + v1.BasicLevel = (function() { + + /** + * Properties of a BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IBasicLevel + * @property {Array.|null} [conditions] BasicLevel conditions + * @property {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null} [combiningFunction] BasicLevel combiningFunction + */ + + /** + * Constructs a new BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a BasicLevel. + * @implements IBasicLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + */ + function BasicLevel(properties) { + this.conditions = []; + 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]]; + } + + /** + * BasicLevel conditions. + * @member {Array.} conditions + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.conditions = $util.emptyArray; + + /** + * BasicLevel combiningFunction. + * @member {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction} combiningFunction + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.combiningFunction = 0; + + /** + * Creates a new BasicLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel instance + */ + BasicLevel.create = function create(properties) { + return new BasicLevel(properties); + }; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.identity.accesscontextmanager.v1.Condition.encode(message.conditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.combiningFunction != null && Object.hasOwnProperty.call(message, "combiningFunction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.combiningFunction); + return writer; + }; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.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.identity.accesscontextmanager.v1.BasicLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.identity.accesscontextmanager.v1.Condition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.combiningFunction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + switch (message.combiningFunction) { + default: + return "combiningFunction: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a BasicLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + */ + BasicLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.BasicLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.BasicLevel(); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: object expected"); + message.conditions[i] = $root.google.identity.accesscontextmanager.v1.Condition.fromObject(object.conditions[i]); + } + } + switch (object.combiningFunction) { + default: + if (typeof object.combiningFunction === "number") { + message.combiningFunction = object.combiningFunction; + break; + } + break; + case "AND": + case 0: + message.combiningFunction = 0; + break; + case "OR": + case 1: + message.combiningFunction = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.BasicLevel} message BasicLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (options.defaults) + object.combiningFunction = options.enums === String ? "AND" : 0; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.identity.accesscontextmanager.v1.Condition.toObject(message.conditions[j], options); + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + object.combiningFunction = options.enums === String ? $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] === undefined ? message.combiningFunction : $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] : message.combiningFunction; + return object; + }; + + /** + * Converts this BasicLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + * @returns {Object.} JSON object + */ + BasicLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BasicLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BasicLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.BasicLevel"; + }; + + /** + * ConditionCombiningFunction enum. + * @name google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + * @enum {number} + * @property {number} AND=0 AND value + * @property {number} OR=1 OR value + */ + BasicLevel.ConditionCombiningFunction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AND"] = 0; + values[valuesById[1] = "OR"] = 1; + return values; + })(); + + return BasicLevel; + })(); + + v1.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICondition + * @property {Array.|null} [ipSubnetworks] Condition ipSubnetworks + * @property {google.identity.accesscontextmanager.v1.IDevicePolicy|null} [devicePolicy] Condition devicePolicy + * @property {Array.|null} [requiredAccessLevels] Condition requiredAccessLevels + * @property {boolean|null} [negate] Condition negate + * @property {Array.|null} [members] Condition members + * @property {Array.|null} [regions] Condition regions + */ + + /** + * Constructs a new Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + this.ipSubnetworks = []; + this.requiredAccessLevels = []; + this.members = []; + this.regions = []; + 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]]; + } + + /** + * Condition ipSubnetworks. + * @member {Array.} ipSubnetworks + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.ipSubnetworks = $util.emptyArray; + + /** + * Condition devicePolicy. + * @member {google.identity.accesscontextmanager.v1.IDevicePolicy|null|undefined} devicePolicy + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.devicePolicy = null; + + /** + * Condition requiredAccessLevels. + * @member {Array.} requiredAccessLevels + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.requiredAccessLevels = $util.emptyArray; + + /** + * Condition negate. + * @member {boolean} negate + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.negate = false; + + /** + * Condition members. + * @member {Array.} members + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.members = $util.emptyArray; + + /** + * Condition regions. + * @member {Array.} regions + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.regions = $util.emptyArray; + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipSubnetworks != null && message.ipSubnetworks.length) + for (var i = 0; i < message.ipSubnetworks.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipSubnetworks[i]); + if (message.devicePolicy != null && Object.hasOwnProperty.call(message, "devicePolicy")) + $root.google.identity.accesscontextmanager.v1.DevicePolicy.encode(message.devicePolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requiredAccessLevels != null && message.requiredAccessLevels.length) + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requiredAccessLevels[i]); + if (message.negate != null && Object.hasOwnProperty.call(message, "negate")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.negate); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.members[i]); + if (message.regions != null && message.regions.length) + for (var i = 0; i < message.regions.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.regions[i]); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.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.identity.accesscontextmanager.v1.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ipSubnetworks && message.ipSubnetworks.length)) + message.ipSubnetworks = []; + message.ipSubnetworks.push(reader.string()); + break; + } + case 2: { + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.requiredAccessLevels && message.requiredAccessLevels.length)) + message.requiredAccessLevels = []; + message.requiredAccessLevels.push(reader.string()); + break; + } + case 5: { + message.negate = reader.bool(); + break; + } + case 6: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 7: { + if (!(message.regions && message.regions.length)) + message.regions = []; + message.regions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipSubnetworks != null && message.hasOwnProperty("ipSubnetworks")) { + if (!Array.isArray(message.ipSubnetworks)) + return "ipSubnetworks: array expected"; + for (var i = 0; i < message.ipSubnetworks.length; ++i) + if (!$util.isString(message.ipSubnetworks[i])) + return "ipSubnetworks: string[] expected"; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) { + var error = $root.google.identity.accesscontextmanager.v1.DevicePolicy.verify(message.devicePolicy); + if (error) + return "devicePolicy." + error; + } + if (message.requiredAccessLevels != null && message.hasOwnProperty("requiredAccessLevels")) { + if (!Array.isArray(message.requiredAccessLevels)) + return "requiredAccessLevels: array expected"; + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + if (!$util.isString(message.requiredAccessLevels[i])) + return "requiredAccessLevels: string[] expected"; + } + if (message.negate != null && message.hasOwnProperty("negate")) + if (typeof message.negate !== "boolean") + return "negate: boolean expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.regions != null && message.hasOwnProperty("regions")) { + if (!Array.isArray(message.regions)) + return "regions: array expected"; + for (var i = 0; i < message.regions.length; ++i) + if (!$util.isString(message.regions[i])) + return "regions: string[] expected"; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.Condition) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.Condition(); + if (object.ipSubnetworks) { + if (!Array.isArray(object.ipSubnetworks)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.ipSubnetworks: array expected"); + message.ipSubnetworks = []; + for (var i = 0; i < object.ipSubnetworks.length; ++i) + message.ipSubnetworks[i] = String(object.ipSubnetworks[i]); + } + if (object.devicePolicy != null) { + if (typeof object.devicePolicy !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.devicePolicy: object expected"); + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.fromObject(object.devicePolicy); + } + if (object.requiredAccessLevels) { + if (!Array.isArray(object.requiredAccessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.requiredAccessLevels: array expected"); + message.requiredAccessLevels = []; + for (var i = 0; i < object.requiredAccessLevels.length; ++i) + message.requiredAccessLevels[i] = String(object.requiredAccessLevels[i]); + } + if (object.negate != null) + message.negate = Boolean(object.negate); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.regions) { + if (!Array.isArray(object.regions)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.regions: array expected"); + message.regions = []; + for (var i = 0; i < object.regions.length; ++i) + message.regions[i] = String(object.regions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipSubnetworks = []; + object.requiredAccessLevels = []; + object.members = []; + object.regions = []; + } + if (options.defaults) { + object.devicePolicy = null; + object.negate = false; + } + if (message.ipSubnetworks && message.ipSubnetworks.length) { + object.ipSubnetworks = []; + for (var j = 0; j < message.ipSubnetworks.length; ++j) + object.ipSubnetworks[j] = message.ipSubnetworks[j]; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) + object.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.toObject(message.devicePolicy, options); + if (message.requiredAccessLevels && message.requiredAccessLevels.length) { + object.requiredAccessLevels = []; + for (var j = 0; j < message.requiredAccessLevels.length; ++j) + object.requiredAccessLevels[j] = message.requiredAccessLevels[j]; + } + if (message.negate != null && message.hasOwnProperty("negate")) + object.negate = message.negate; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.regions && message.regions.length) { + object.regions = []; + for (var j = 0; j < message.regions.length; ++j) + object.regions[j] = message.regions[j]; + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.Condition"; + }; + + return Condition; + })(); + + v1.CustomLevel = (function() { + + /** + * Properties of a CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICustomLevel + * @property {google.type.IExpr|null} [expr] CustomLevel expr + */ + + /** + * Constructs a new CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a CustomLevel. + * @implements ICustomLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + */ + function CustomLevel(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]]; + } + + /** + * CustomLevel expr. + * @member {google.type.IExpr|null|undefined} expr + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + */ + CustomLevel.prototype.expr = null; + + /** + * Creates a new CustomLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel instance + */ + CustomLevel.create = function create(properties) { + return new CustomLevel(properties); + }; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.google.type.Expr.encode(message.expr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.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.identity.accesscontextmanager.v1.CustomLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expr = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.google.type.Expr.verify(message.expr); + if (error) + return "expr." + error; + } + return null; + }; + + /** + * Creates a CustomLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + */ + CustomLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.CustomLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.CustomLevel(); + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.CustomLevel.expr: object expected"); + message.expr = $root.google.type.Expr.fromObject(object.expr); + } + return message; + }; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.CustomLevel} message CustomLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expr = null; + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.google.type.Expr.toObject(message.expr, options); + return object; + }; + + /** + * Converts this CustomLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + * @returns {Object.} JSON object + */ + CustomLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.CustomLevel"; + }; + + return CustomLevel; + })(); + + v1.DevicePolicy = (function() { + + /** + * Properties of a DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IDevicePolicy + * @property {boolean|null} [requireScreenlock] DevicePolicy requireScreenlock + * @property {Array.|null} [allowedEncryptionStatuses] DevicePolicy allowedEncryptionStatuses + * @property {Array.|null} [osConstraints] DevicePolicy osConstraints + * @property {Array.|null} [allowedDeviceManagementLevels] DevicePolicy allowedDeviceManagementLevels + * @property {boolean|null} [requireAdminApproval] DevicePolicy requireAdminApproval + * @property {boolean|null} [requireCorpOwned] DevicePolicy requireCorpOwned + */ + + /** + * Constructs a new DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a DevicePolicy. + * @implements IDevicePolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + */ + function DevicePolicy(properties) { + this.allowedEncryptionStatuses = []; + this.osConstraints = []; + this.allowedDeviceManagementLevels = []; + 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]]; + } + + /** + * DevicePolicy requireScreenlock. + * @member {boolean} requireScreenlock + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireScreenlock = false; + + /** + * DevicePolicy allowedEncryptionStatuses. + * @member {Array.} allowedEncryptionStatuses + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedEncryptionStatuses = $util.emptyArray; + + /** + * DevicePolicy osConstraints. + * @member {Array.} osConstraints + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.osConstraints = $util.emptyArray; + + /** + * DevicePolicy allowedDeviceManagementLevels. + * @member {Array.} allowedDeviceManagementLevels + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedDeviceManagementLevels = $util.emptyArray; + + /** + * DevicePolicy requireAdminApproval. + * @member {boolean} requireAdminApproval + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireAdminApproval = false; + + /** + * DevicePolicy requireCorpOwned. + * @member {boolean} requireCorpOwned + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireCorpOwned = false; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy instance + */ + DevicePolicy.create = function create(properties) { + return new DevicePolicy(properties); + }; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireScreenlock != null && Object.hasOwnProperty.call(message, "requireScreenlock")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireScreenlock); + if (message.allowedEncryptionStatuses != null && message.allowedEncryptionStatuses.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + writer.int32(message.allowedEncryptionStatuses[i]); + writer.ldelim(); + } + if (message.osConstraints != null && message.osConstraints.length) + for (var i = 0; i < message.osConstraints.length; ++i) + $root.google.identity.accesscontextmanager.v1.OsConstraint.encode(message.osConstraints[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowedDeviceManagementLevels != null && message.allowedDeviceManagementLevels.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + writer.int32(message.allowedDeviceManagementLevels[i]); + writer.ldelim(); + } + if (message.requireAdminApproval != null && Object.hasOwnProperty.call(message, "requireAdminApproval")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requireAdminApproval); + if (message.requireCorpOwned != null && Object.hasOwnProperty.call(message, "requireCorpOwned")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.requireCorpOwned); + return writer; + }; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.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.identity.accesscontextmanager.v1.DevicePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requireScreenlock = reader.bool(); + break; + } + case 2: { + if (!(message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length)) + message.allowedEncryptionStatuses = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedEncryptionStatuses.push(reader.int32()); + } else + message.allowedEncryptionStatuses.push(reader.int32()); + break; + } + case 3: { + if (!(message.osConstraints && message.osConstraints.length)) + message.osConstraints = []; + message.osConstraints.push($root.google.identity.accesscontextmanager.v1.OsConstraint.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length)) + message.allowedDeviceManagementLevels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedDeviceManagementLevels.push(reader.int32()); + } else + message.allowedDeviceManagementLevels.push(reader.int32()); + break; + } + case 7: { + message.requireAdminApproval = reader.bool(); + break; + } + case 8: { + message.requireCorpOwned = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DevicePolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DevicePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + if (typeof message.requireScreenlock !== "boolean") + return "requireScreenlock: boolean expected"; + if (message.allowedEncryptionStatuses != null && message.hasOwnProperty("allowedEncryptionStatuses")) { + if (!Array.isArray(message.allowedEncryptionStatuses)) + return "allowedEncryptionStatuses: array expected"; + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + switch (message.allowedEncryptionStatuses[i]) { + default: + return "allowedEncryptionStatuses: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.osConstraints != null && message.hasOwnProperty("osConstraints")) { + if (!Array.isArray(message.osConstraints)) + return "osConstraints: array expected"; + for (var i = 0; i < message.osConstraints.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.OsConstraint.verify(message.osConstraints[i]); + if (error) + return "osConstraints." + error; + } + } + if (message.allowedDeviceManagementLevels != null && message.hasOwnProperty("allowedDeviceManagementLevels")) { + if (!Array.isArray(message.allowedDeviceManagementLevels)) + return "allowedDeviceManagementLevels: array expected"; + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + switch (message.allowedDeviceManagementLevels[i]) { + default: + return "allowedDeviceManagementLevels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + if (typeof message.requireAdminApproval !== "boolean") + return "requireAdminApproval: boolean expected"; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + if (typeof message.requireCorpOwned !== "boolean") + return "requireCorpOwned: boolean expected"; + return null; + }; + + /** + * Creates a DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + */ + DevicePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.DevicePolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.DevicePolicy(); + if (object.requireScreenlock != null) + message.requireScreenlock = Boolean(object.requireScreenlock); + if (object.allowedEncryptionStatuses) { + if (!Array.isArray(object.allowedEncryptionStatuses)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedEncryptionStatuses: array expected"); + message.allowedEncryptionStatuses = []; + for (var i = 0; i < object.allowedEncryptionStatuses.length; ++i) + switch (object.allowedEncryptionStatuses[i]) { + default: + if (typeof object.allowedEncryptionStatuses[i] === "number") { + message.allowedEncryptionStatuses[i] = object.allowedEncryptionStatuses[i]; + break; + } + case "ENCRYPTION_UNSPECIFIED": + case 0: + message.allowedEncryptionStatuses[i] = 0; + break; + case "ENCRYPTION_UNSUPPORTED": + case 1: + message.allowedEncryptionStatuses[i] = 1; + break; + case "UNENCRYPTED": + case 2: + message.allowedEncryptionStatuses[i] = 2; + break; + case "ENCRYPTED": + case 3: + message.allowedEncryptionStatuses[i] = 3; + break; + } + } + if (object.osConstraints) { + if (!Array.isArray(object.osConstraints)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: array expected"); + message.osConstraints = []; + for (var i = 0; i < object.osConstraints.length; ++i) { + if (typeof object.osConstraints[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: object expected"); + message.osConstraints[i] = $root.google.identity.accesscontextmanager.v1.OsConstraint.fromObject(object.osConstraints[i]); + } + } + if (object.allowedDeviceManagementLevels) { + if (!Array.isArray(object.allowedDeviceManagementLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedDeviceManagementLevels: array expected"); + message.allowedDeviceManagementLevels = []; + for (var i = 0; i < object.allowedDeviceManagementLevels.length; ++i) + switch (object.allowedDeviceManagementLevels[i]) { + default: + if (typeof object.allowedDeviceManagementLevels[i] === "number") { + message.allowedDeviceManagementLevels[i] = object.allowedDeviceManagementLevels[i]; + break; + } + case "MANAGEMENT_UNSPECIFIED": + case 0: + message.allowedDeviceManagementLevels[i] = 0; + break; + case "NONE": + case 1: + message.allowedDeviceManagementLevels[i] = 1; + break; + case "BASIC": + case 2: + message.allowedDeviceManagementLevels[i] = 2; + break; + case "COMPLETE": + case 3: + message.allowedDeviceManagementLevels[i] = 3; + break; + } + } + if (object.requireAdminApproval != null) + message.requireAdminApproval = Boolean(object.requireAdminApproval); + if (object.requireCorpOwned != null) + message.requireCorpOwned = Boolean(object.requireCorpOwned); + return message; + }; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.DevicePolicy} message DevicePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DevicePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedEncryptionStatuses = []; + object.osConstraints = []; + object.allowedDeviceManagementLevels = []; + } + if (options.defaults) { + object.requireScreenlock = false; + object.requireAdminApproval = false; + object.requireCorpOwned = false; + } + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + object.requireScreenlock = message.requireScreenlock; + if (message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length) { + object.allowedEncryptionStatuses = []; + for (var j = 0; j < message.allowedEncryptionStatuses.length; ++j) + object.allowedEncryptionStatuses[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] === undefined ? message.allowedEncryptionStatuses[j] : $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] : message.allowedEncryptionStatuses[j]; + } + if (message.osConstraints && message.osConstraints.length) { + object.osConstraints = []; + for (var j = 0; j < message.osConstraints.length; ++j) + object.osConstraints[j] = $root.google.identity.accesscontextmanager.v1.OsConstraint.toObject(message.osConstraints[j], options); + } + if (message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length) { + object.allowedDeviceManagementLevels = []; + for (var j = 0; j < message.allowedDeviceManagementLevels.length; ++j) + object.allowedDeviceManagementLevels[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] === undefined ? message.allowedDeviceManagementLevels[j] : $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] : message.allowedDeviceManagementLevels[j]; + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + object.requireAdminApproval = message.requireAdminApproval; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + object.requireCorpOwned = message.requireCorpOwned; + return object; + }; + + /** + * Converts this DevicePolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + * @returns {Object.} JSON object + */ + DevicePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DevicePolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DevicePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.DevicePolicy"; + }; + + return DevicePolicy; + })(); + + v1.OsConstraint = (function() { + + /** + * Properties of an OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IOsConstraint + * @property {google.identity.accesscontextmanager.type.OsType|null} [osType] OsConstraint osType + * @property {string|null} [minimumVersion] OsConstraint minimumVersion + * @property {boolean|null} [requireVerifiedChromeOs] OsConstraint requireVerifiedChromeOs + */ + + /** + * Constructs a new OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an OsConstraint. + * @implements IOsConstraint + * @constructor + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + */ + function OsConstraint(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]]; + } + + /** + * OsConstraint osType. + * @member {google.identity.accesscontextmanager.type.OsType} osType + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.osType = 0; + + /** + * OsConstraint minimumVersion. + * @member {string} minimumVersion + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.minimumVersion = ""; + + /** + * OsConstraint requireVerifiedChromeOs. + * @member {boolean} requireVerifiedChromeOs + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.requireVerifiedChromeOs = false; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint instance + */ + OsConstraint.create = function create(properties) { + return new OsConstraint(properties); + }; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osType != null && Object.hasOwnProperty.call(message, "osType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.osType); + if (message.minimumVersion != null && Object.hasOwnProperty.call(message, "minimumVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.minimumVersion); + if (message.requireVerifiedChromeOs != null && Object.hasOwnProperty.call(message, "requireVerifiedChromeOs")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requireVerifiedChromeOs); + return writer; + }; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.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.identity.accesscontextmanager.v1.OsConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osType = reader.int32(); + break; + } + case 2: { + message.minimumVersion = reader.string(); + break; + } + case 3: { + message.requireVerifiedChromeOs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsConstraint message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osType != null && message.hasOwnProperty("osType")) + switch (message.osType) { + default: + return "osType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + case 4: + case 5: + break; + } + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + if (!$util.isString(message.minimumVersion)) + return "minimumVersion: string expected"; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + if (typeof message.requireVerifiedChromeOs !== "boolean") + return "requireVerifiedChromeOs: boolean expected"; + return null; + }; + + /** + * Creates an OsConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + */ + OsConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.OsConstraint) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.OsConstraint(); + switch (object.osType) { + default: + if (typeof object.osType === "number") { + message.osType = object.osType; + break; + } + break; + case "OS_UNSPECIFIED": + case 0: + message.osType = 0; + break; + case "DESKTOP_MAC": + case 1: + message.osType = 1; + break; + case "DESKTOP_WINDOWS": + case 2: + message.osType = 2; + break; + case "DESKTOP_LINUX": + case 3: + message.osType = 3; + break; + case "DESKTOP_CHROME_OS": + case 6: + message.osType = 6; + break; + case "ANDROID": + case 4: + message.osType = 4; + break; + case "IOS": + case 5: + message.osType = 5; + break; + } + if (object.minimumVersion != null) + message.minimumVersion = String(object.minimumVersion); + if (object.requireVerifiedChromeOs != null) + message.requireVerifiedChromeOs = Boolean(object.requireVerifiedChromeOs); + return message; + }; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.OsConstraint} message OsConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osType = options.enums === String ? "OS_UNSPECIFIED" : 0; + object.minimumVersion = ""; + object.requireVerifiedChromeOs = false; + } + if (message.osType != null && message.hasOwnProperty("osType")) + object.osType = options.enums === String ? $root.google.identity.accesscontextmanager.type.OsType[message.osType] === undefined ? message.osType : $root.google.identity.accesscontextmanager.type.OsType[message.osType] : message.osType; + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + object.minimumVersion = message.minimumVersion; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + object.requireVerifiedChromeOs = message.requireVerifiedChromeOs; + return object; + }; + + /** + * Converts this OsConstraint to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + * @returns {Object.} JSON object + */ + OsConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OsConstraint + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.OsConstraint"; + }; + + return OsConstraint; + })(); + + v1.AccessPolicy = (function() { + + /** + * Properties of an AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessPolicy + * @property {string|null} [name] AccessPolicy name + * @property {string|null} [parent] AccessPolicy parent + * @property {string|null} [title] AccessPolicy title + * @property {Array.|null} [scopes] AccessPolicy scopes + * @property {google.protobuf.ITimestamp|null} [createTime] AccessPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessPolicy updateTime + * @property {string|null} [etag] AccessPolicy etag + */ + + /** + * Constructs a new AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessPolicy. + * @implements IAccessPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + */ + function AccessPolicy(properties) { + this.scopes = []; + 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]]; + } + + /** + * AccessPolicy name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.name = ""; + + /** + * AccessPolicy parent. + * @member {string} parent + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.parent = ""; + + /** + * AccessPolicy title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.title = ""; + + /** + * AccessPolicy scopes. + * @member {Array.} scopes + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.scopes = $util.emptyArray; + + /** + * AccessPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.createTime = null; + + /** + * AccessPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.updateTime = null; + + /** + * AccessPolicy etag. + * @member {string} etag + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.etag = ""; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy instance + */ + AccessPolicy.create = function create(properties) { + return new AccessPolicy(properties); + }; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.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.identity.accesscontextmanager.v1.AccessPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.title = reader.string(); + break; + } + case 7: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + */ + AccessPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.title != null) + message.title = String(object.title); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.AccessPolicy} message AccessPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.title = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this AccessPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + * @returns {Object.} JSON object + */ + AccessPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessPolicy"; + }; + + return AccessPolicy; + })(); + + v1.ServicePerimeter = (function() { + + /** + * Properties of a ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeter + * @property {string|null} [name] ServicePerimeter name + * @property {string|null} [title] ServicePerimeter title + * @property {string|null} [description] ServicePerimeter description + * @property {google.protobuf.ITimestamp|null} [createTime] ServicePerimeter createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ServicePerimeter updateTime + * @property {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null} [perimeterType] ServicePerimeter perimeterType + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [status] ServicePerimeter status + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [spec] ServicePerimeter spec + * @property {boolean|null} [useExplicitDryRunSpec] ServicePerimeter useExplicitDryRunSpec + */ + + /** + * Constructs a new ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeter. + * @implements IServicePerimeter + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + */ + function ServicePerimeter(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]]; + } + + /** + * ServicePerimeter name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.name = ""; + + /** + * ServicePerimeter title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.title = ""; + + /** + * ServicePerimeter description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.description = ""; + + /** + * ServicePerimeter createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.createTime = null; + + /** + * ServicePerimeter updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.updateTime = null; + + /** + * ServicePerimeter perimeterType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType} perimeterType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.perimeterType = 0; + + /** + * ServicePerimeter status. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} status + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.status = null; + + /** + * ServicePerimeter spec. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} spec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.spec = null; + + /** + * ServicePerimeter useExplicitDryRunSpec. + * @member {boolean} useExplicitDryRunSpec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.useExplicitDryRunSpec = false; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter instance + */ + ServicePerimeter.create = function create(properties) { + return new ServicePerimeter(properties); + }; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.perimeterType != null && Object.hasOwnProperty.call(message, "perimeterType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.perimeterType); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.spec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.useExplicitDryRunSpec != null && Object.hasOwnProperty.call(message, "useExplicitDryRunSpec")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.useExplicitDryRunSpec); + return writer; + }; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.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.identity.accesscontextmanager.v1.ServicePerimeter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.perimeterType = reader.int32(); + break; + } + case 7: { + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.useExplicitDryRunSpec = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServicePerimeter message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeter.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.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + switch (message.perimeterType) { + default: + return "perimeterType: enum value expected"; + case 0: + case 1: + break; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.status); + if (error) + return "status." + error; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + if (typeof message.useExplicitDryRunSpec !== "boolean") + return "useExplicitDryRunSpec: boolean expected"; + return null; + }; + + /** + * Creates a ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + */ + ServicePerimeter.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeter) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeter(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.perimeterType) { + default: + if (typeof object.perimeterType === "number") { + message.perimeterType = object.perimeterType; + break; + } + break; + case "PERIMETER_TYPE_REGULAR": + case 0: + message.perimeterType = 0; + break; + case "PERIMETER_TYPE_BRIDGE": + case 1: + message.perimeterType = 1; + break; + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.status: object expected"); + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.status); + } + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.spec: object expected"); + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.spec); + } + if (object.useExplicitDryRunSpec != null) + message.useExplicitDryRunSpec = Boolean(object.useExplicitDryRunSpec); + return message; + }; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeter} message ServicePerimeter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.perimeterType = options.enums === String ? "PERIMETER_TYPE_REGULAR" : 0; + object.status = null; + object.spec = null; + object.useExplicitDryRunSpec = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + object.perimeterType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] === undefined ? message.perimeterType : $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] : message.perimeterType; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.status, options); + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.spec, options); + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + object.useExplicitDryRunSpec = message.useExplicitDryRunSpec; + return object; + }; + + /** + * Converts this ServicePerimeter to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServicePerimeter + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeter"; + }; + + /** + * PerimeterType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + * @enum {number} + * @property {number} PERIMETER_TYPE_REGULAR=0 PERIMETER_TYPE_REGULAR value + * @property {number} PERIMETER_TYPE_BRIDGE=1 PERIMETER_TYPE_BRIDGE value + */ + ServicePerimeter.PerimeterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERIMETER_TYPE_REGULAR"] = 0; + values[valuesById[1] = "PERIMETER_TYPE_BRIDGE"] = 1; + return values; + })(); + + return ServicePerimeter; + })(); + + v1.ServicePerimeterConfig = (function() { + + /** + * Properties of a ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeterConfig + * @property {Array.|null} [resources] ServicePerimeterConfig resources + * @property {Array.|null} [accessLevels] ServicePerimeterConfig accessLevels + * @property {Array.|null} [restrictedServices] ServicePerimeterConfig restrictedServices + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null} [vpcAccessibleServices] ServicePerimeterConfig vpcAccessibleServices + * @property {Array.|null} [ingressPolicies] ServicePerimeterConfig ingressPolicies + * @property {Array.|null} [egressPolicies] ServicePerimeterConfig egressPolicies + */ + + /** + * Constructs a new ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeterConfig. + * @implements IServicePerimeterConfig + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + */ + function ServicePerimeterConfig(properties) { + this.resources = []; + this.accessLevels = []; + this.restrictedServices = []; + this.ingressPolicies = []; + this.egressPolicies = []; + 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]]; + } + + /** + * ServicePerimeterConfig resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.resources = $util.emptyArray; + + /** + * ServicePerimeterConfig accessLevels. + * @member {Array.} accessLevels + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.accessLevels = $util.emptyArray; + + /** + * ServicePerimeterConfig restrictedServices. + * @member {Array.} restrictedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.restrictedServices = $util.emptyArray; + + /** + * ServicePerimeterConfig vpcAccessibleServices. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null|undefined} vpcAccessibleServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.vpcAccessibleServices = null; + + /** + * ServicePerimeterConfig ingressPolicies. + * @member {Array.} ingressPolicies + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.ingressPolicies = $util.emptyArray; + + /** + * ServicePerimeterConfig egressPolicies. + * @member {Array.} egressPolicies + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.egressPolicies = $util.emptyArray; + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig instance + */ + ServicePerimeterConfig.create = function create(properties) { + return new ServicePerimeterConfig(properties); + }; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.accessLevels != null && message.accessLevels.length) + for (var i = 0; i < message.accessLevels.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessLevels[i]); + if (message.restrictedServices != null && message.restrictedServices.length) + for (var i = 0; i < message.restrictedServices.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.restrictedServices[i]); + if (message.ingressPolicies != null && message.ingressPolicies.length) + for (var i = 0; i < message.ingressPolicies.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.encode(message.ingressPolicies[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.egressPolicies != null && message.egressPolicies.length) + for (var i = 0; i < message.egressPolicies.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.encode(message.egressPolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.vpcAccessibleServices != null && Object.hasOwnProperty.call(message, "vpcAccessibleServices")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.encode(message.vpcAccessibleServices, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.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.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.accessLevels && message.accessLevels.length)) + message.accessLevels = []; + message.accessLevels.push(reader.string()); + break; + } + case 4: { + if (!(message.restrictedServices && message.restrictedServices.length)) + message.restrictedServices = []; + message.restrictedServices.push(reader.string()); + break; + } + case 10: { + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.ingressPolicies && message.ingressPolicies.length)) + message.ingressPolicies = []; + message.ingressPolicies.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.egressPolicies && message.egressPolicies.length)) + message.egressPolicies = []; + message.egressPolicies.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServicePerimeterConfig message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeterConfig.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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.accessLevels != null && message.hasOwnProperty("accessLevels")) { + if (!Array.isArray(message.accessLevels)) + return "accessLevels: array expected"; + for (var i = 0; i < message.accessLevels.length; ++i) + if (!$util.isString(message.accessLevels[i])) + return "accessLevels: string[] expected"; + } + if (message.restrictedServices != null && message.hasOwnProperty("restrictedServices")) { + if (!Array.isArray(message.restrictedServices)) + return "restrictedServices: array expected"; + for (var i = 0; i < message.restrictedServices.length; ++i) + if (!$util.isString(message.restrictedServices[i])) + return "restrictedServices: string[] expected"; + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify(message.vpcAccessibleServices); + if (error) + return "vpcAccessibleServices." + error; + } + if (message.ingressPolicies != null && message.hasOwnProperty("ingressPolicies")) { + if (!Array.isArray(message.ingressPolicies)) + return "ingressPolicies: array expected"; + for (var i = 0; i < message.ingressPolicies.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify(message.ingressPolicies[i]); + if (error) + return "ingressPolicies." + error; + } + } + if (message.egressPolicies != null && message.hasOwnProperty("egressPolicies")) { + if (!Array.isArray(message.egressPolicies)) + return "egressPolicies: array expected"; + for (var i = 0; i < message.egressPolicies.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify(message.egressPolicies[i]); + if (error) + return "egressPolicies." + error; + } + } + return null; + }; + + /** + * Creates a ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + */ + ServicePerimeterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.accessLevels) { + if (!Array.isArray(object.accessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.accessLevels: array expected"); + message.accessLevels = []; + for (var i = 0; i < object.accessLevels.length; ++i) + message.accessLevels[i] = String(object.accessLevels[i]); + } + if (object.restrictedServices) { + if (!Array.isArray(object.restrictedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.restrictedServices: array expected"); + message.restrictedServices = []; + for (var i = 0; i < object.restrictedServices.length; ++i) + message.restrictedServices[i] = String(object.restrictedServices[i]); + } + if (object.vpcAccessibleServices != null) { + if (typeof object.vpcAccessibleServices !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.vpcAccessibleServices: object expected"); + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.fromObject(object.vpcAccessibleServices); + } + if (object.ingressPolicies) { + if (!Array.isArray(object.ingressPolicies)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ingressPolicies: array expected"); + message.ingressPolicies = []; + for (var i = 0; i < object.ingressPolicies.length; ++i) { + if (typeof object.ingressPolicies[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ingressPolicies: object expected"); + message.ingressPolicies[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.fromObject(object.ingressPolicies[i]); + } + } + if (object.egressPolicies) { + if (!Array.isArray(object.egressPolicies)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.egressPolicies: array expected"); + message.egressPolicies = []; + for (var i = 0; i < object.egressPolicies.length; ++i) { + if (typeof object.egressPolicies[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.egressPolicies: object expected"); + message.egressPolicies[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.fromObject(object.egressPolicies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} message ServicePerimeterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accessLevels = []; + object.restrictedServices = []; + object.ingressPolicies = []; + object.egressPolicies = []; + } + if (options.defaults) + object.vpcAccessibleServices = null; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.accessLevels && message.accessLevels.length) { + object.accessLevels = []; + for (var j = 0; j < message.accessLevels.length; ++j) + object.accessLevels[j] = message.accessLevels[j]; + } + if (message.restrictedServices && message.restrictedServices.length) { + object.restrictedServices = []; + for (var j = 0; j < message.restrictedServices.length; ++j) + object.restrictedServices[j] = message.restrictedServices[j]; + } + if (message.ingressPolicies && message.ingressPolicies.length) { + object.ingressPolicies = []; + for (var j = 0; j < message.ingressPolicies.length; ++j) + object.ingressPolicies[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.toObject(message.ingressPolicies[j], options); + } + if (message.egressPolicies && message.egressPolicies.length) { + object.egressPolicies = []; + for (var j = 0; j < message.egressPolicies.length; ++j) + object.egressPolicies[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.toObject(message.egressPolicies[j], options); + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) + object.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.toObject(message.vpcAccessibleServices, options); + return object; + }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig"; + }; + + ServicePerimeterConfig.VpcAccessibleServices = (function() { + + /** + * Properties of a VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IVpcAccessibleServices + * @property {boolean|null} [enableRestriction] VpcAccessibleServices enableRestriction + * @property {Array.|null} [allowedServices] VpcAccessibleServices allowedServices + */ + + /** + * Constructs a new VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a VpcAccessibleServices. + * @implements IVpcAccessibleServices + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + */ + function VpcAccessibleServices(properties) { + this.allowedServices = []; + 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]]; + } + + /** + * VpcAccessibleServices enableRestriction. + * @member {boolean} enableRestriction + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.enableRestriction = false; + + /** + * VpcAccessibleServices allowedServices. + * @member {Array.} allowedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.allowedServices = $util.emptyArray; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices instance + */ + VpcAccessibleServices.create = function create(properties) { + return new VpcAccessibleServices(properties); + }; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRestriction != null && Object.hasOwnProperty.call(message, "enableRestriction")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRestriction); + if (message.allowedServices != null && message.allowedServices.length) + for (var i = 0; i < message.allowedServices.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedServices[i]); + return writer; + }; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableRestriction = reader.bool(); + break; + } + case 2: { + if (!(message.allowedServices && message.allowedServices.length)) + message.allowedServices = []; + message.allowedServices.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcAccessibleServices message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcAccessibleServices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + if (typeof message.enableRestriction !== "boolean") + return "enableRestriction: boolean expected"; + if (message.allowedServices != null && message.hasOwnProperty("allowedServices")) { + if (!Array.isArray(message.allowedServices)) + return "allowedServices: array expected"; + for (var i = 0; i < message.allowedServices.length; ++i) + if (!$util.isString(message.allowedServices[i])) + return "allowedServices: string[] expected"; + } + return null; + }; + + /** + * Creates a VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + */ + VpcAccessibleServices.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + if (object.enableRestriction != null) + message.enableRestriction = Boolean(object.enableRestriction); + if (object.allowedServices) { + if (!Array.isArray(object.allowedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.allowedServices: array expected"); + message.allowedServices = []; + for (var i = 0; i < object.allowedServices.length; ++i) + message.allowedServices[i] = String(object.allowedServices[i]); + } + return message; + }; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} message VpcAccessibleServices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcAccessibleServices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedServices = []; + if (options.defaults) + object.enableRestriction = false; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + object.enableRestriction = message.enableRestriction; + if (message.allowedServices && message.allowedServices.length) { + object.allowedServices = []; + for (var j = 0; j < message.allowedServices.length; ++j) + object.allowedServices[j] = message.allowedServices[j]; + } + return object; + }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + * @returns {Object.} JSON object + */ + VpcAccessibleServices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcAccessibleServices + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcAccessibleServices.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices"; + }; + + return VpcAccessibleServices; + })(); + + /** + * IdentityType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType + * @enum {number} + * @property {number} IDENTITY_TYPE_UNSPECIFIED=0 IDENTITY_TYPE_UNSPECIFIED value + * @property {number} ANY_IDENTITY=1 ANY_IDENTITY value + * @property {number} ANY_USER_ACCOUNT=2 ANY_USER_ACCOUNT value + * @property {number} ANY_SERVICE_ACCOUNT=3 ANY_SERVICE_ACCOUNT value + */ + ServicePerimeterConfig.IdentityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDENTITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ANY_IDENTITY"] = 1; + values[valuesById[2] = "ANY_USER_ACCOUNT"] = 2; + values[valuesById[3] = "ANY_SERVICE_ACCOUNT"] = 3; + return values; + })(); + + ServicePerimeterConfig.MethodSelector = (function() { + + /** + * Properties of a MethodSelector. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IMethodSelector + * @property {string|null} [method] MethodSelector method + * @property {string|null} [permission] MethodSelector permission + */ + + /** + * Constructs a new MethodSelector. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a MethodSelector. + * @implements IMethodSelector + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector=} [properties] Properties to set + */ + function MethodSelector(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]]; + } + + /** + * MethodSelector method. + * @member {string|null|undefined} method + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + MethodSelector.prototype.method = null; + + /** + * MethodSelector permission. + * @member {string|null|undefined} permission + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + MethodSelector.prototype.permission = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MethodSelector kind. + * @member {"method"|"permission"|undefined} kind + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + Object.defineProperty(MethodSelector.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["method", "permission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MethodSelector instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector instance + */ + MethodSelector.create = function create(properties) { + return new MethodSelector(properties); + }; + + /** + * Encodes the specified MethodSelector message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector} message MethodSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.method); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + return writer; + }; + + /** + * Encodes the specified MethodSelector message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector} message MethodSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSelector message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSelector.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.method = reader.string(); + break; + } + case 2: { + message.permission = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSelector message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.method != null && message.hasOwnProperty("method")) { + properties.kind = 1; + if (!$util.isString(message.method)) + return "method: string expected"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.permission)) + return "permission: string expected"; + } + return null; + }; + + /** + * Creates a MethodSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + */ + MethodSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector(); + if (object.method != null) + message.method = String(object.method); + if (object.permission != null) + message.permission = String(object.permission); + return message; + }; + + /** + * Creates a plain object from a MethodSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} message MethodSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.method != null && message.hasOwnProperty("method")) { + object.method = message.method; + if (options.oneofs) + object.kind = "method"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + object.permission = message.permission; + if (options.oneofs) + object.kind = "permission"; + } + return object; + }; + + /** + * Converts this MethodSelector to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + * @returns {Object.} JSON object + */ + MethodSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSelector + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector"; + }; + + return MethodSelector; + })(); + + ServicePerimeterConfig.ApiOperation = (function() { + + /** + * Properties of an ApiOperation. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IApiOperation + * @property {string|null} [serviceName] ApiOperation serviceName + * @property {Array.|null} [methodSelectors] ApiOperation methodSelectors + */ + + /** + * Constructs a new ApiOperation. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an ApiOperation. + * @implements IApiOperation + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation=} [properties] Properties to set + */ + function ApiOperation(properties) { + this.methodSelectors = []; + 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]]; + } + + /** + * ApiOperation serviceName. + * @member {string} serviceName + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + */ + ApiOperation.prototype.serviceName = ""; + + /** + * ApiOperation methodSelectors. + * @member {Array.} methodSelectors + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + */ + ApiOperation.prototype.methodSelectors = $util.emptyArray; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation instance + */ + ApiOperation.create = function create(properties) { + return new ApiOperation(properties); + }; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.methodSelectors != null && message.methodSelectors.length) + for (var i = 0; i < message.methodSelectors.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.encode(message.methodSelectors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + if (!(message.methodSelectors && message.methodSelectors.length)) + message.methodSelectors = []; + message.methodSelectors.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiOperation message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.methodSelectors != null && message.hasOwnProperty("methodSelectors")) { + if (!Array.isArray(message.methodSelectors)) + return "methodSelectors: array expected"; + for (var i = 0; i < message.methodSelectors.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify(message.methodSelectors[i]); + if (error) + return "methodSelectors." + error; + } + } + return null; + }; + + /** + * Creates an ApiOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + */ + ApiOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.methodSelectors) { + if (!Array.isArray(object.methodSelectors)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.methodSelectors: array expected"); + message.methodSelectors = []; + for (var i = 0; i < object.methodSelectors.length; ++i) { + if (typeof object.methodSelectors[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.methodSelectors: object expected"); + message.methodSelectors[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.fromObject(object.methodSelectors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} message ApiOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methodSelectors = []; + if (options.defaults) + object.serviceName = ""; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.methodSelectors && message.methodSelectors.length) { + object.methodSelectors = []; + for (var j = 0; j < message.methodSelectors.length; ++j) + object.methodSelectors[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.toObject(message.methodSelectors[j], options); + } + return object; + }; + + /** + * Converts this ApiOperation to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + * @returns {Object.} JSON object + */ + ApiOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiOperation + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation"; + }; + + return ApiOperation; + })(); + + ServicePerimeterConfig.IngressSource = (function() { + + /** + * Properties of an IngressSource. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressSource + * @property {string|null} [accessLevel] IngressSource accessLevel + * @property {string|null} [resource] IngressSource resource + */ + + /** + * Constructs a new IngressSource. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressSource. + * @implements IIngressSource + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource=} [properties] Properties to set + */ + function IngressSource(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]]; + } + + /** + * IngressSource accessLevel. + * @member {string|null|undefined} accessLevel + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + IngressSource.prototype.accessLevel = null; + + /** + * IngressSource resource. + * @member {string|null|undefined} resource + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + IngressSource.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngressSource source. + * @member {"accessLevel"|"resource"|undefined} source + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + Object.defineProperty(IngressSource.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["accessLevel", "resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngressSource instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource instance + */ + IngressSource.create = function create(properties) { + return new IngressSource(properties); + }; + + /** + * Encodes the specified IngressSource message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource} message IngressSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessLevel); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + return writer; + }; + + /** + * Encodes the specified IngressSource message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource} message IngressSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressSource message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressSource.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessLevel = reader.string(); + break; + } + case 2: { + message.resource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressSource message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + properties.source = 1; + if (!$util.isString(message.accessLevel)) + return "accessLevel: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.resource)) + return "resource: string expected"; + } + return null; + }; + + /** + * Creates an IngressSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + */ + IngressSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource(); + if (object.accessLevel != null) + message.accessLevel = String(object.accessLevel); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from an IngressSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} message IngressSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = message.accessLevel; + if (options.oneofs) + object.source = "accessLevel"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = message.resource; + if (options.oneofs) + object.source = "resource"; + } + return object; + }; + + /** + * Converts this IngressSource to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + * @returns {Object.} JSON object + */ + IngressSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressSource + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource"; + }; + + return IngressSource; + })(); + + ServicePerimeterConfig.IngressFrom = (function() { + + /** + * Properties of an IngressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressFrom + * @property {Array.|null} [sources] IngressFrom sources + * @property {Array.|null} [identities] IngressFrom identities + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null} [identityType] IngressFrom identityType + */ + + /** + * Constructs a new IngressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressFrom. + * @implements IIngressFrom + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom=} [properties] Properties to set + */ + function IngressFrom(properties) { + this.sources = []; + this.identities = []; + 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]]; + } + + /** + * IngressFrom sources. + * @member {Array.} sources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.sources = $util.emptyArray; + + /** + * IngressFrom identities. + * @member {Array.} identities + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.identities = $util.emptyArray; + + /** + * IngressFrom identityType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType} identityType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.identityType = 0; + + /** + * Creates a new IngressFrom instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom instance + */ + IngressFrom.create = function create(properties) { + return new IngressFrom(properties); + }; + + /** + * Encodes the specified IngressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom} message IngressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressFrom.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.identities[i]); + if (message.identityType != null && Object.hasOwnProperty.call(message, "identityType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.identityType); + return writer; + }; + + /** + * Encodes the specified IngressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom} message IngressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressFrom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressFrom message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressFrom.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.string()); + break; + } + case 3: { + message.identityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressFrom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressFrom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressFrom message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressFrom.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + 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) + if (!$util.isString(message.identities[i])) + return "identities: string[] expected"; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + switch (message.identityType) { + default: + return "identityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an IngressFrom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + */ + IngressFrom.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.sources: object expected"); + message.sources[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.fromObject(object.sources[i]); + } + } + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + message.identities[i] = String(object.identities[i]); + } + switch (object.identityType) { + default: + if (typeof object.identityType === "number") { + message.identityType = object.identityType; + break; + } + break; + case "IDENTITY_TYPE_UNSPECIFIED": + case 0: + message.identityType = 0; + break; + case "ANY_IDENTITY": + case 1: + message.identityType = 1; + break; + case "ANY_USER_ACCOUNT": + case 2: + message.identityType = 2; + break; + case "ANY_SERVICE_ACCOUNT": + case 3: + message.identityType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an IngressFrom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} message IngressFrom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressFrom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.identities = []; + } + if (options.defaults) + object.identityType = options.enums === String ? "IDENTITY_TYPE_UNSPECIFIED" : 0; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.toObject(message.sources[j], options); + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = message.identities[j]; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + object.identityType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] === undefined ? message.identityType : $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] : message.identityType; + return object; + }; + + /** + * Converts this IngressFrom to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + * @returns {Object.} JSON object + */ + IngressFrom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressFrom + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressFrom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom"; + }; + + return IngressFrom; + })(); + + ServicePerimeterConfig.IngressTo = (function() { + + /** + * Properties of an IngressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressTo + * @property {Array.|null} [operations] IngressTo operations + * @property {Array.|null} [resources] IngressTo resources + */ + + /** + * Constructs a new IngressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressTo. + * @implements IIngressTo + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo=} [properties] Properties to set + */ + function IngressTo(properties) { + this.operations = []; + this.resources = []; + 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]]; + } + + /** + * IngressTo operations. + * @member {Array.} operations + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + */ + IngressTo.prototype.operations = $util.emptyArray; + + /** + * IngressTo resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + */ + IngressTo.prototype.resources = $util.emptyArray; + + /** + * Creates a new IngressTo instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo instance + */ + IngressTo.create = function create(properties) { + return new IngressTo(properties); + }; + + /** + * Encodes the specified IngressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo} message IngressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressTo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resources[i]); + return writer; + }; + + /** + * Encodes the specified IngressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo} message IngressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressTo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressTo message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressTo.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressTo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressTo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressTo message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressTo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + 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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + return null; + }; + + /** + * Creates an IngressTo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + */ + IngressTo.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.operations: object expected"); + message.operations[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.fromObject(object.operations[i]); + } + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + return message; + }; + + /** + * Creates a plain object from an IngressTo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} message IngressTo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressTo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.operations = []; + object.resources = []; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.toObject(message.operations[j], options); + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + return object; + }; + + /** + * Converts this IngressTo to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + * @returns {Object.} JSON object + */ + IngressTo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressTo + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressTo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo"; + }; + + return IngressTo; + })(); + + ServicePerimeterConfig.IngressPolicy = (function() { + + /** + * Properties of an IngressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressPolicy + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null} [ingressFrom] IngressPolicy ingressFrom + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null} [ingressTo] IngressPolicy ingressTo + */ + + /** + * Constructs a new IngressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressPolicy. + * @implements IIngressPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy=} [properties] Properties to set + */ + function IngressPolicy(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]]; + } + + /** + * IngressPolicy ingressFrom. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null|undefined} ingressFrom + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + */ + IngressPolicy.prototype.ingressFrom = null; + + /** + * IngressPolicy ingressTo. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null|undefined} ingressTo + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + */ + IngressPolicy.prototype.ingressTo = null; + + /** + * Creates a new IngressPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy instance + */ + IngressPolicy.create = function create(properties) { + return new IngressPolicy(properties); + }; + + /** + * Encodes the specified IngressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy} message IngressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingressFrom != null && Object.hasOwnProperty.call(message, "ingressFrom")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.encode(message.ingressFrom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ingressTo != null && Object.hasOwnProperty.call(message, "ingressTo")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.encode(message.ingressTo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy} message IngressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressPolicy.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ingressFrom != null && message.hasOwnProperty("ingressFrom")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify(message.ingressFrom); + if (error) + return "ingressFrom." + error; + } + if (message.ingressTo != null && message.hasOwnProperty("ingressTo")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify(message.ingressTo); + if (error) + return "ingressTo." + error; + } + return null; + }; + + /** + * Creates an IngressPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + */ + IngressPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy(); + if (object.ingressFrom != null) { + if (typeof object.ingressFrom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.ingressFrom: object expected"); + message.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.fromObject(object.ingressFrom); + } + if (object.ingressTo != null) { + if (typeof object.ingressTo !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.ingressTo: object expected"); + message.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.fromObject(object.ingressTo); + } + return message; + }; + + /** + * Creates a plain object from an IngressPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} message IngressPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ingressFrom = null; + object.ingressTo = null; + } + if (message.ingressFrom != null && message.hasOwnProperty("ingressFrom")) + object.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.toObject(message.ingressFrom, options); + if (message.ingressTo != null && message.hasOwnProperty("ingressTo")) + object.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.toObject(message.ingressTo, options); + return object; + }; + + /** + * Converts this IngressPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + * @returns {Object.} JSON object + */ + IngressPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy"; + }; + + return IngressPolicy; + })(); + + ServicePerimeterConfig.EgressFrom = (function() { + + /** + * Properties of an EgressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressFrom + * @property {Array.|null} [identities] EgressFrom identities + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null} [identityType] EgressFrom identityType + */ + + /** + * Constructs a new EgressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressFrom. + * @implements IEgressFrom + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom=} [properties] Properties to set + */ + function EgressFrom(properties) { + this.identities = []; + 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]]; + } + + /** + * EgressFrom identities. + * @member {Array.} identities + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + */ + EgressFrom.prototype.identities = $util.emptyArray; + + /** + * EgressFrom identityType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType} identityType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + */ + EgressFrom.prototype.identityType = 0; + + /** + * Creates a new EgressFrom instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom instance + */ + EgressFrom.create = function create(properties) { + return new EgressFrom(properties); + }; + + /** + * Encodes the specified EgressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom} message EgressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressFrom.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identities[i]); + if (message.identityType != null && Object.hasOwnProperty.call(message, "identityType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.identityType); + return writer; + }; + + /** + * Encodes the specified EgressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom} message EgressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressFrom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressFrom message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressFrom.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.string()); + break; + } + case 2: { + message.identityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressFrom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressFrom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressFrom message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressFrom.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) + if (!$util.isString(message.identities[i])) + return "identities: string[] expected"; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + switch (message.identityType) { + default: + return "identityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an EgressFrom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + */ + EgressFrom.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + message.identities[i] = String(object.identities[i]); + } + switch (object.identityType) { + default: + if (typeof object.identityType === "number") { + message.identityType = object.identityType; + break; + } + break; + case "IDENTITY_TYPE_UNSPECIFIED": + case 0: + message.identityType = 0; + break; + case "ANY_IDENTITY": + case 1: + message.identityType = 1; + break; + case "ANY_USER_ACCOUNT": + case 2: + message.identityType = 2; + break; + case "ANY_SERVICE_ACCOUNT": + case 3: + message.identityType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an EgressFrom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} message EgressFrom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressFrom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identities = []; + if (options.defaults) + object.identityType = options.enums === String ? "IDENTITY_TYPE_UNSPECIFIED" : 0; + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = message.identities[j]; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + object.identityType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] === undefined ? message.identityType : $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] : message.identityType; + return object; + }; + + /** + * Converts this EgressFrom to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + * @returns {Object.} JSON object + */ + EgressFrom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressFrom + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressFrom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom"; + }; + + return EgressFrom; + })(); + + ServicePerimeterConfig.EgressTo = (function() { + + /** + * Properties of an EgressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressTo + * @property {Array.|null} [resources] EgressTo resources + * @property {Array.|null} [operations] EgressTo operations + * @property {Array.|null} [externalResources] EgressTo externalResources + */ + + /** + * Constructs a new EgressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressTo. + * @implements IEgressTo + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo=} [properties] Properties to set + */ + function EgressTo(properties) { + this.resources = []; + this.operations = []; + this.externalResources = []; + 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]]; + } + + /** + * EgressTo resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.resources = $util.emptyArray; + + /** + * EgressTo operations. + * @member {Array.} operations + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.operations = $util.emptyArray; + + /** + * EgressTo externalResources. + * @member {Array.} externalResources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.externalResources = $util.emptyArray; + + /** + * Creates a new EgressTo instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo instance + */ + EgressTo.create = function create(properties) { + return new EgressTo(properties); + }; + + /** + * Encodes the specified EgressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo} message EgressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressTo.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.encode(message.operations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.externalResources != null && message.externalResources.length) + for (var i = 0; i < message.externalResources.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalResources[i]); + return writer; + }; + + /** + * Encodes the specified EgressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo} message EgressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressTo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressTo message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressTo.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.externalResources && message.externalResources.length)) + message.externalResources = []; + message.externalResources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressTo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressTo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressTo message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressTo.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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.externalResources != null && message.hasOwnProperty("externalResources")) { + if (!Array.isArray(message.externalResources)) + return "externalResources: array expected"; + for (var i = 0; i < message.externalResources.length; ++i) + if (!$util.isString(message.externalResources[i])) + return "externalResources: string[] expected"; + } + return null; + }; + + /** + * Creates an EgressTo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + */ + EgressTo.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.operations: object expected"); + message.operations[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.fromObject(object.operations[i]); + } + } + if (object.externalResources) { + if (!Array.isArray(object.externalResources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.externalResources: array expected"); + message.externalResources = []; + for (var i = 0; i < object.externalResources.length; ++i) + message.externalResources[i] = String(object.externalResources[i]); + } + return message; + }; + + /** + * Creates a plain object from an EgressTo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} message EgressTo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressTo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.operations = []; + object.externalResources = []; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.toObject(message.operations[j], options); + } + if (message.externalResources && message.externalResources.length) { + object.externalResources = []; + for (var j = 0; j < message.externalResources.length; ++j) + object.externalResources[j] = message.externalResources[j]; + } + return object; + }; + + /** + * Converts this EgressTo to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + * @returns {Object.} JSON object + */ + EgressTo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressTo + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressTo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo"; + }; + + return EgressTo; + })(); + + ServicePerimeterConfig.EgressPolicy = (function() { + + /** + * Properties of an EgressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressPolicy + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null} [egressFrom] EgressPolicy egressFrom + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null} [egressTo] EgressPolicy egressTo + */ + + /** + * Constructs a new EgressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressPolicy. + * @implements IEgressPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy=} [properties] Properties to set + */ + function EgressPolicy(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]]; + } + + /** + * EgressPolicy egressFrom. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null|undefined} egressFrom + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + */ + EgressPolicy.prototype.egressFrom = null; + + /** + * EgressPolicy egressTo. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null|undefined} egressTo + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + */ + EgressPolicy.prototype.egressTo = null; + + /** + * Creates a new EgressPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy instance + */ + EgressPolicy.create = function create(properties) { + return new EgressPolicy(properties); + }; + + /** + * Encodes the specified EgressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy} message EgressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.egressFrom != null && Object.hasOwnProperty.call(message, "egressFrom")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.encode(message.egressFrom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.egressTo != null && Object.hasOwnProperty.call(message, "egressTo")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.encode(message.egressTo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EgressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy} message EgressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressPolicy.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.decode(reader, reader.uint32()); + break; + } + case 2: { + message.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.egressFrom != null && message.hasOwnProperty("egressFrom")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify(message.egressFrom); + if (error) + return "egressFrom." + error; + } + if (message.egressTo != null && message.hasOwnProperty("egressTo")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify(message.egressTo); + if (error) + return "egressTo." + error; + } + return null; + }; + + /** + * Creates an EgressPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + */ + EgressPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy(); + if (object.egressFrom != null) { + if (typeof object.egressFrom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.egressFrom: object expected"); + message.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.fromObject(object.egressFrom); + } + if (object.egressTo != null) { + if (typeof object.egressTo !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.egressTo: object expected"); + message.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.fromObject(object.egressTo); + } + return message; + }; + + /** + * Creates a plain object from an EgressPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} message EgressPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.egressFrom = null; + object.egressTo = null; + } + if (message.egressFrom != null && message.hasOwnProperty("egressFrom")) + object.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.toObject(message.egressFrom, options); + if (message.egressTo != null && message.hasOwnProperty("egressTo")) + object.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.toObject(message.egressTo, options); + return object; + }; + + /** + * Converts this EgressPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + * @returns {Object.} JSON object + */ + EgressPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy"; + }; + + return EgressPolicy; + })(); + + return ServicePerimeterConfig; + })(); + + return v1; + })(); + + accesscontextmanager.type = (function() { + + /** + * Namespace type. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var type = {}; + + /** + * DeviceEncryptionStatus enum. + * @name google.identity.accesscontextmanager.type.DeviceEncryptionStatus + * @enum {number} + * @property {number} ENCRYPTION_UNSPECIFIED=0 ENCRYPTION_UNSPECIFIED value + * @property {number} ENCRYPTION_UNSUPPORTED=1 ENCRYPTION_UNSUPPORTED value + * @property {number} UNENCRYPTED=2 UNENCRYPTED value + * @property {number} ENCRYPTED=3 ENCRYPTED value + */ + type.DeviceEncryptionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENCRYPTION_UNSUPPORTED"] = 1; + values[valuesById[2] = "UNENCRYPTED"] = 2; + values[valuesById[3] = "ENCRYPTED"] = 3; + return values; + })(); + + /** + * OsType enum. + * @name google.identity.accesscontextmanager.type.OsType + * @enum {number} + * @property {number} OS_UNSPECIFIED=0 OS_UNSPECIFIED value + * @property {number} DESKTOP_MAC=1 DESKTOP_MAC value + * @property {number} DESKTOP_WINDOWS=2 DESKTOP_WINDOWS value + * @property {number} DESKTOP_LINUX=3 DESKTOP_LINUX value + * @property {number} DESKTOP_CHROME_OS=6 DESKTOP_CHROME_OS value + * @property {number} ANDROID=4 ANDROID value + * @property {number} IOS=5 IOS value + */ + type.OsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OS_UNSPECIFIED"] = 0; + values[valuesById[1] = "DESKTOP_MAC"] = 1; + values[valuesById[2] = "DESKTOP_WINDOWS"] = 2; + values[valuesById[3] = "DESKTOP_LINUX"] = 3; + values[valuesById[6] = "DESKTOP_CHROME_OS"] = 6; + values[valuesById[4] = "ANDROID"] = 4; + values[valuesById[5] = "IOS"] = 5; + return values; + })(); + + /** + * DeviceManagementLevel enum. + * @name google.identity.accesscontextmanager.type.DeviceManagementLevel + * @enum {number} + * @property {number} MANAGEMENT_UNSPECIFIED=0 MANAGEMENT_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} BASIC=2 BASIC value + * @property {number} COMPLETE=3 COMPLETE value + */ + type.DeviceManagementLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANAGEMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "BASIC"] = 2; + values[valuesById[3] = "COMPLETE"] = 3; + return values; + })(); + + return type; + })(); + + return accesscontextmanager; + })(); + + return identity; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.json b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.json new file mode 100644 index 00000000000..873596d9b4f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/protos/protos.json @@ -0,0 +1,3137 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "asset": { + "nested": { + "v1p2beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1P2Beta1", + "go_package": "cloud.google.com/go/asset/apiv1p2beta1/assetpb;assetpb", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p2beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p2beta1" + }, + "nested": { + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateFeed": { + "requestType": "CreateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).post": "/v1p2beta1/{parent=*/*}/feeds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p2beta1/{parent=*/*}/feeds", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetFeed": { + "requestType": "GetFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).get": "/v1p2beta1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p2beta1/{name=*/*/feeds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListFeeds": { + "requestType": "ListFeedsRequest", + "responseType": "ListFeedsResponse", + "options": { + "(google.api.http).get": "/v1p2beta1/{parent=*/*}/feeds", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p2beta1/{parent=*/*}/feeds" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateFeed": { + "requestType": "UpdateFeedRequest", + "responseType": "Feed", + "options": { + "(google.api.http).patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", + "(google.api.http).body": "*", + "(google.api.method_signature)": "feed" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1p2beta1/{feed.name=*/*/feeds/*}", + "body": "*" + } + }, + { + "(google.api.method_signature)": "feed" + } + ] + }, + "DeleteFeed": { + "requestType": "DeleteFeedRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1p2beta1/{name=*/*/feeds/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1p2beta1/{name=*/*/feeds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ExportAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 2 + } + } + }, + "BatchGetAssetsHistoryResponse": { + "fields": { + "assets": { + "rule": "repeated", + "type": "TemporalAsset", + "id": 1 + } + } + }, + "CreateFeedRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feedId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "feed": { + "type": "Feed", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetFeedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } + } + } + }, + "ListFeedsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListFeedsResponse": { + "fields": { + "feeds": { + "rule": "repeated", + "type": "Feed", + "id": 1 + } + } + }, + "UpdateFeedRequest": { + "fields": { + "feed": { + "type": "Feed", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteFeedRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Feed" + } + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "GcsDestination": { + "oneofs": { + "objectUri": { + "oneof": [ + "uri" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2 + } + }, + "PubsubDestination": { + "fields": { + "topic": { + "type": "string", + "id": 1 + } + } + }, + "FeedOutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "pubsubDestination" + ] + } + }, + "fields": { + "pubsubDestination": { + "type": "PubsubDestination", + "id": 1 + } + } + }, + "Feed": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Feed", + "(google.api.resource).pattern": "organizations/{organization}/feeds/{feed}", + "(google.api.resource).history": "ORIGINALLY_SINGLE_PATTERN" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "assetNames": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "feedOutputConfig": { + "type": "FeedOutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TemporalAsset": { + "fields": { + "window": { + "type": "TimeWindow", + "id": 1 + }, + "deleted": { + "type": "bool", + "id": 2 + }, + "asset": { + "type": "Asset", + "id": 3 + } + } + }, + "TimeWindow": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, + "oneofs": { + "accessContextPolicy": { + "oneof": [ + "accessPolicy", + "accessLevel", + "servicePerimeter" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "accessPolicy": { + "type": "google.identity.accesscontextmanager.v1.AccessPolicy", + "id": 7 + }, + "accessLevel": { + "type": "google.identity.accesscontextmanager.v1.AccessLevel", + "id": 8 + }, + "servicePerimeter": { + "type": "google.identity.accesscontextmanager.v1.ServicePerimeter", + "id": 9 + }, + "orgPolicy": { + "rule": "repeated", + "type": "google.cloud.orgpolicy.v1.Policy", + "id": 10 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + } + } + } + } + }, + "orgpolicy": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OrgPolicy.V1", + "go_package": "cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb", + "java_multiple_files": true, + "java_outer_classname": "OrgPolicyProto", + "java_package": "com.google.cloud.orgpolicy.v1", + "php_namespace": "Google\\Cloud\\OrgPolicy\\V1", + "ruby_package": "Google::Cloud::OrgPolicy::V1" + }, + "nested": { + "Policy": { + "oneofs": { + "policyType": { + "oneof": [ + "listPolicy", + "booleanPolicy", + "restoreDefault" + ] + } + }, + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "constraint": { + "type": "string", + "id": 2 + }, + "etag": { + "type": "bytes", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "listPolicy": { + "type": "ListPolicy", + "id": 5 + }, + "booleanPolicy": { + "type": "BooleanPolicy", + "id": 6 + }, + "restoreDefault": { + "type": "RestoreDefault", + "id": 7 + } + }, + "nested": { + "ListPolicy": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "deniedValues": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "allValues": { + "type": "AllValues", + "id": 3 + }, + "suggestedValue": { + "type": "string", + "id": 4 + }, + "inheritFromParent": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "AllValues": { + "values": { + "ALL_VALUES_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 + } + } + } + }, + "BooleanPolicy": { + "fields": { + "enforced": { + "type": "bool", + "id": 1 + } + } + }, + "RestoreDefault": { + "fields": {} + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "identity": { + "nested": { + "accesscontextmanager": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.V1", + "go_package": "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb", + "java_multiple_files": true, + "java_outer_classname": "ServicePerimeterProto", + "java_package": "com.google.identity.accesscontextmanager.v1", + "objc_class_prefix": "GACM", + "php_namespace": "Google\\Identity\\AccessContextManager\\V1", + "ruby_package": "Google::Identity::AccessContextManager::V1" + }, + "nested": { + "AccessLevel": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/AccessLevel", + "(google.api.resource).pattern": "accessPolicies/{access_policy}/accessLevels/{access_level}" + }, + "oneofs": { + "level": { + "oneof": [ + "basic", + "custom" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "basic": { + "type": "BasicLevel", + "id": 4 + }, + "custom": { + "type": "CustomLevel", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "BasicLevel": { + "fields": { + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 1 + }, + "combiningFunction": { + "type": "ConditionCombiningFunction", + "id": 2 + } + }, + "nested": { + "ConditionCombiningFunction": { + "values": { + "AND": 0, + "OR": 1 + } + } + } + }, + "Condition": { + "fields": { + "ipSubnetworks": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "devicePolicy": { + "type": "DevicePolicy", + "id": 2 + }, + "requiredAccessLevels": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "negate": { + "type": "bool", + "id": 5 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "regions": { + "rule": "repeated", + "type": "string", + "id": 7 + } + } + }, + "CustomLevel": { + "fields": { + "expr": { + "type": "google.type.Expr", + "id": 1 + } + } + }, + "DevicePolicy": { + "fields": { + "requireScreenlock": { + "type": "bool", + "id": 1 + }, + "allowedEncryptionStatuses": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceEncryptionStatus", + "id": 2 + }, + "osConstraints": { + "rule": "repeated", + "type": "OsConstraint", + "id": 3 + }, + "allowedDeviceManagementLevels": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceManagementLevel", + "id": 6 + }, + "requireAdminApproval": { + "type": "bool", + "id": 7 + }, + "requireCorpOwned": { + "type": "bool", + "id": 8 + } + } + }, + "OsConstraint": { + "fields": { + "osType": { + "type": "google.identity.accesscontextmanager.type.OsType", + "id": 1 + }, + "minimumVersion": { + "type": "string", + "id": 2 + }, + "requireVerifiedChromeOs": { + "type": "bool", + "id": 3 + } + } + }, + "AccessPolicy": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/AccessPolicy", + "(google.api.resource).pattern": "accessPolicies/{access_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "title": { + "type": "string", + "id": 3 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + }, + "ServicePerimeter": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/ServicePerimeter", + "(google.api.resource).pattern": "accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "perimeterType": { + "type": "PerimeterType", + "id": 6 + }, + "status": { + "type": "ServicePerimeterConfig", + "id": 7 + }, + "spec": { + "type": "ServicePerimeterConfig", + "id": 8 + }, + "useExplicitDryRunSpec": { + "type": "bool", + "id": 9 + } + }, + "nested": { + "PerimeterType": { + "values": { + "PERIMETER_TYPE_REGULAR": 0, + "PERIMETER_TYPE_BRIDGE": 1 + } + } + } + }, + "ServicePerimeterConfig": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "accessLevels": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "restrictedServices": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "vpcAccessibleServices": { + "type": "VpcAccessibleServices", + "id": 10 + }, + "ingressPolicies": { + "rule": "repeated", + "type": "IngressPolicy", + "id": 8 + }, + "egressPolicies": { + "rule": "repeated", + "type": "EgressPolicy", + "id": 9 + } + }, + "nested": { + "VpcAccessibleServices": { + "fields": { + "enableRestriction": { + "type": "bool", + "id": 1 + }, + "allowedServices": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "IdentityType": { + "values": { + "IDENTITY_TYPE_UNSPECIFIED": 0, + "ANY_IDENTITY": 1, + "ANY_USER_ACCOUNT": 2, + "ANY_SERVICE_ACCOUNT": 3 + } + }, + "MethodSelector": { + "oneofs": { + "kind": { + "oneof": [ + "method", + "permission" + ] + } + }, + "fields": { + "method": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + } + } + }, + "ApiOperation": { + "fields": { + "serviceName": { + "type": "string", + "id": 1 + }, + "methodSelectors": { + "rule": "repeated", + "type": "MethodSelector", + "id": 2 + } + } + }, + "IngressSource": { + "oneofs": { + "source": { + "oneof": [ + "accessLevel", + "resource" + ] + } + }, + "fields": { + "accessLevel": { + "type": "string", + "id": 1 + }, + "resource": { + "type": "string", + "id": 2 + } + } + }, + "IngressFrom": { + "fields": { + "sources": { + "rule": "repeated", + "type": "IngressSource", + "id": 1 + }, + "identities": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "identityType": { + "type": "IdentityType", + "id": 3 + } + } + }, + "IngressTo": { + "fields": { + "operations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 1 + }, + "resources": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "IngressPolicy": { + "fields": { + "ingressFrom": { + "type": "IngressFrom", + "id": 1 + }, + "ingressTo": { + "type": "IngressTo", + "id": 2 + } + } + }, + "EgressFrom": { + "fields": { + "identities": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "identityType": { + "type": "IdentityType", + "id": 2 + } + } + }, + "EgressTo": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "operations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 2 + }, + "externalResources": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "EgressPolicy": { + "fields": { + "egressFrom": { + "type": "EgressFrom", + "id": 1 + }, + "egressTo": { + "type": "EgressTo", + "id": 2 + } + } + } + } + } + } + }, + "type": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.Type", + "go_package": "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type", + "java_package": "com.google.identity.accesscontextmanager.type", + "java_multiple_files": true, + "java_outer_classname": "TypeProto", + "php_namespace": "Google\\Identity\\AccessContextManager\\Type", + "ruby_package": "Google::Identity::AccessContextManager::Type" + }, + "nested": { + "DeviceEncryptionStatus": { + "values": { + "ENCRYPTION_UNSPECIFIED": 0, + "ENCRYPTION_UNSUPPORTED": 1, + "UNENCRYPTED": 2, + "ENCRYPTED": 3 + } + }, + "OsType": { + "values": { + "OS_UNSPECIFIED": 0, + "DESKTOP_MAC": 1, + "DESKTOP_WINDOWS": 2, + "DESKTOP_LINUX": 3, + "DESKTOP_CHROME_OS": 6, + "ANDROID": 4, + "IOS": 5 + } + }, + "DeviceManagementLevel": { + "values": { + "MANAGEMENT_UNSPECIFIED": 0, + "NONE": 1, + "BASIC": 2, + "COMPLETE": 3 + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.create_feed.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.create_feed.js new file mode 100644 index 00000000000..c439ce48ef4 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.create_feed.js @@ -0,0 +1,79 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, feedId, feed) { + // [START cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + */ + // const parent = 'abc123' + /** + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + */ + // const feedId = 'abc123' + /** + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const feed = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callCreateFeed() { + // Construct request + const request = { + parent, + feedId, + feed, + }; + + // Run request + const response = await assetClient.createFeed(request); + console.log(response); + } + + callCreateFeed(); + // [END cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.delete_feed.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.delete_feed.js new file mode 100644 index 00000000000..bd2c359cfaa --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.delete_feed.js @@ -0,0 +1,64 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callDeleteFeed() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.deleteFeed(request); + console.log(response); + } + + callDeleteFeed(); + // [END cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.get_feed.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.get_feed.js new file mode 100644 index 00000000000..46dab9ac7c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.get_feed.js @@ -0,0 +1,64 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudasset_v1p2beta1_generated_AssetService_GetFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + */ + // const name = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callGetFeed() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await assetClient.getFeed(request); + console.log(response); + } + + callGetFeed(); + // [END cloudasset_v1p2beta1_generated_AssetService_GetFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.list_feeds.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.list_feeds.js new file mode 100644 index 00000000000..01c97e8382b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.list_feeds.js @@ -0,0 +1,63 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + */ + // const parent = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callListFeeds() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await assetClient.listFeeds(request); + console.log(response); + } + + callListFeeds(); + // [END cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.update_feed.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.update_feed.js new file mode 100644 index 00000000000..3c725779a09 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/asset_service.update_feed.js @@ -0,0 +1,72 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(feed, updateMask) { + // [START cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + */ + // const feed = {} + /** + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + */ + // const updateMask = {} + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p2beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callUpdateFeed() { + // Construct request + const request = { + feed, + updateMask, + }; + + // Run request + const response = await assetClient.updateFeed(request); + console.log(response); + } + + callUpdateFeed(); + // [END cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/snippet_metadata_google.cloud.asset.v1p2beta1.json b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/snippet_metadata_google.cloud.asset.v1p2beta1.json new file mode 100644 index 00000000000..1ce701288c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/samples/generated/v1p2beta1/snippet_metadata_google.cloud.asset.v1p2beta1.json @@ -0,0 +1,227 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p2beta1", + "version": "v1p2beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async", + "title": "AssetService createFeed Sample", + "origin": "API_DEFINITION", + "description": " Creates a feed in a parent project/folder/organization to listen to its asset updates.", + "canonical": true, + "file": "asset_service.create_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.CreateFeed", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "feed_id", + "type": "TYPE_STRING" + }, + { + "name": "feed", + "type": ".google.cloud.asset.v1p2beta1.Feed" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "CreateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.CreateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_GetFeed_async", + "title": "AssetService getFeed Sample", + "origin": "API_DEFINITION", + "description": " Gets details about an asset feed.", + "canonical": true, + "file": "asset_service.get_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.GetFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "GetFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.GetFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async", + "title": "AssetService listFeeds Sample", + "origin": "API_DEFINITION", + "description": " Lists all asset feeds in a parent project/folder/organization.", + "canonical": true, + "file": "asset_service.list_feeds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.ListFeeds", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.ListFeedsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "ListFeeds", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.ListFeeds", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async", + "title": "AssetService updateFeed Sample", + "origin": "API_DEFINITION", + "description": " Updates an asset feed configuration.", + "canonical": true, + "file": "asset_service.update_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.UpdateFeed", + "async": true, + "parameters": [ + { + "name": "feed", + "type": ".google.cloud.asset.v1p2beta1.Feed" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.asset.v1p2beta1.Feed", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "UpdateFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.UpdateFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + }, + { + "regionTag": "cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async", + "title": "AssetService deleteFeed Sample", + "origin": "API_DEFINITION", + "description": " Deletes an asset feed.", + "canonical": true, + "file": "asset_service.delete_feed.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.DeleteFeed", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p2beta1.AssetServiceClient" + }, + "method": { + "shortName": "DeleteFeed", + "fullName": "google.cloud.asset.v1p2beta1.AssetService.DeleteFeed", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p2beta1.AssetService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/src/index.ts b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/index.ts new file mode 100644 index 00000000000..967f5d94155 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 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 v1p2beta1 from './v1p2beta1'; +const AssetServiceClient = v1p2beta1.AssetServiceClient; +type AssetServiceClient = v1p2beta1.AssetServiceClient; +export {v1p2beta1, AssetServiceClient}; +export default {v1p2beta1, AssetServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_client.ts b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_client.ts new file mode 100644 index 00000000000..2dc9a83657f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_client.ts @@ -0,0 +1,944 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1p2beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './asset_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p2beta1 + */ +export class AssetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + assetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AssetServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AssetServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'cloudasset.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && '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}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + accessLevelPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/accessLevels/{access_level}' + ), + accessPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}' + ), + folderFeedPathTemplate: new this._gaxModule.PathTemplate( + 'folders/{folder}/feeds/{feed}' + ), + organizationFeedPathTemplate: new this._gaxModule.PathTemplate( + 'organizations/{organization}/feeds/{feed}' + ), + projectFeedPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/feeds/{feed}' + ), + servicePerimeterPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.asset.v1p2beta1.AssetService', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.v1p2beta1.AssetService. + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.asset.v1p2beta1.AssetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.asset.v1p2beta1.AssetService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const assetServiceStubMethods = + ['createFeed', 'getFeed', 'listFeeds', 'updateFeed', 'deleteFeed']; + for (const methodName of assetServiceStubMethods) { + const callPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.assetServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- +/** + * Creates a feed in a parent project/folder/organization to listen to its + * asset updates. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the project/folder/organization where this feed + * should be created in. It can only be an organization number (such as + * "organizations/123"), a folder number (such as "folders/123"), a project ID + * (such as "projects/my-project-id"), or a project number (such as + * "projects/12345"). + * @param {string} request.feedId + * Required. This is the client-assigned asset feed identifier and it needs to + * be unique under a specific parent project/folder/organization. + * @param {google.cloud.asset.v1p2beta1.Feed} request.feed + * Required. The feed details. The field `name` must be empty and it will be + * generated in the format of: projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1p2beta1.Feed|Feed}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p2beta1/asset_service.create_feed.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_CreateFeed_async + */ + createFeed( + request?: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest|undefined, {}|undefined + ]>; + createFeed( + request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest|null|undefined, + {}|null|undefined>): void; + createFeed( + request: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest|null|undefined, + {}|null|undefined>): void; + createFeed( + request?: protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createFeed(request, options, callback); + } +/** + * Gets details about an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @param {object} [options] + * 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 {@link protos.google.cloud.asset.v1p2beta1.Feed|Feed}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p2beta1/asset_service.get_feed.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_GetFeed_async + */ + getFeed( + request?: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest|undefined, {}|undefined + ]>; + getFeed( + request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest|null|undefined, + {}|null|undefined>): void; + getFeed( + request: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest|null|undefined, + {}|null|undefined>): void; + getFeed( + request?: protos.google.cloud.asset.v1p2beta1.IGetFeedRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getFeed(request, options, callback); + } +/** + * Lists all asset feeds in a parent project/folder/organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent project/folder/organization whose feeds are to be + * listed. It can only be using project/folder/organization number (such as + * "folders/12345")", or a project ID (such as "projects/my-project-id"). + * @param {object} [options] + * 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 {@link protos.google.cloud.asset.v1p2beta1.ListFeedsResponse|ListFeedsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p2beta1/asset_service.list_feeds.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_ListFeeds_async + */ + listFeeds( + request?: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest|undefined, {}|undefined + ]>; + listFeeds( + request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest|null|undefined, + {}|null|undefined>): void; + listFeeds( + request: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest|null|undefined, + {}|null|undefined>): void; + listFeeds( + request?: protos.google.cloud.asset.v1p2beta1.IListFeedsRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listFeeds(request, options, callback); + } +/** + * Updates an asset feed configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.asset.v1p2beta1.Feed} request.feed + * Required. The new values of feed details. It must match an existing feed + * and the field `name` must be in the format of: + * projects/project_number/feeds/feed_id or + * folders/folder_number/feeds/feed_id or + * organizations/organization_number/feeds/feed_id. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Only updates the `feed` fields indicated by this mask. + * The field mask must not be empty, and it must not contain fields that + * are immutable or only set by the server. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.asset.v1p2beta1.Feed|Feed}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p2beta1/asset_service.update_feed.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_UpdateFeed_async + */ + updateFeed( + request?: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest|undefined, {}|undefined + ]>; + updateFeed( + request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest|null|undefined, + {}|null|undefined>): void; + updateFeed( + request: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + callback: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest|null|undefined, + {}|null|undefined>): void; + updateFeed( + request?: protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'feed.name': request.feed!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateFeed(request, options, callback); + } +/** + * Deletes an asset feed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the feed and it must be in the format of: + * projects/project_number/feeds/feed_id + * folders/folder_number/feeds/feed_id + * organizations/organization_number/feeds/feed_id + * @param {object} [options] + * 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 {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1p2beta1/asset_service.delete_feed.js + * region_tag:cloudasset_v1p2beta1_generated_AssetService_DeleteFeed_async + */ + deleteFeed( + request?: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + options?: CallOptions): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest|undefined, {}|undefined + ]>; + deleteFeed( + request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest|null|undefined, + {}|null|undefined>): void; + deleteFeed( + request: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest|null|undefined, + {}|null|undefined>): void; + deleteFeed( + request?: protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'name': request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteFeed(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified accessLevel resource name string. + * + * @param {string} access_policy + * @param {string} access_level + * @returns {string} Resource name string. + */ + accessLevelPath(accessPolicy:string,accessLevel:string) { + return this.pathTemplates.accessLevelPathTemplate.render({ + access_policy: accessPolicy, + access_level: accessLevel, + }); + } + + /** + * Parse the access_policy from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName).access_policy; + } + + /** + * Parse the access_level from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_level. + */ + matchAccessLevelFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName).access_level; + } + + /** + * Return a fully-qualified accessPolicy resource name string. + * + * @param {string} access_policy + * @returns {string} Resource name string. + */ + accessPolicyPath(accessPolicy:string) { + return this.pathTemplates.accessPolicyPathTemplate.render({ + access_policy: accessPolicy, + }); + } + + /** + * Parse the access_policy from AccessPolicy resource. + * + * @param {string} accessPolicyName + * A fully-qualified path representing AccessPolicy resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessPolicyName(accessPolicyName: string) { + return this.pathTemplates.accessPolicyPathTemplate.match(accessPolicyName).access_policy; + } + + /** + * Return a fully-qualified folderFeed resource name string. + * + * @param {string} folder + * @param {string} feed + * @returns {string} Resource name string. + */ + folderFeedPath(folder:string,feed:string) { + return this.pathTemplates.folderFeedPathTemplate.render({ + folder: folder, + feed: feed, + }); + } + + /** + * Parse the folder from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderFeedName(folderFeedName: string) { + return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).folder; + } + + /** + * Parse the feed from FolderFeed resource. + * + * @param {string} folderFeedName + * A fully-qualified path representing folder_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromFolderFeedName(folderFeedName: string) { + return this.pathTemplates.folderFeedPathTemplate.match(folderFeedName).feed; + } + + /** + * Return a fully-qualified organizationFeed resource name string. + * + * @param {string} organization + * @param {string} feed + * @returns {string} Resource name string. + */ + organizationFeedPath(organization:string,feed:string) { + return this.pathTemplates.organizationFeedPathTemplate.render({ + organization: organization, + feed: feed, + }); + } + + /** + * Parse the organization from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationFeedName(organizationFeedName: string) { + return this.pathTemplates.organizationFeedPathTemplate.match(organizationFeedName).organization; + } + + /** + * Parse the feed from OrganizationFeed resource. + * + * @param {string} organizationFeedName + * A fully-qualified path representing organization_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromOrganizationFeedName(organizationFeedName: string) { + return this.pathTemplates.organizationFeedPathTemplate.match(organizationFeedName).feed; + } + + /** + * Return a fully-qualified projectFeed resource name string. + * + * @param {string} project + * @param {string} feed + * @returns {string} Resource name string. + */ + projectFeedPath(project:string,feed:string) { + return this.pathTemplates.projectFeedPathTemplate.render({ + project: project, + feed: feed, + }); + } + + /** + * Parse the project from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectFeedName(projectFeedName: string) { + return this.pathTemplates.projectFeedPathTemplate.match(projectFeedName).project; + } + + /** + * Parse the feed from ProjectFeed resource. + * + * @param {string} projectFeedName + * A fully-qualified path representing project_feed resource. + * @returns {string} A string representing the feed. + */ + matchFeedFromProjectFeedName(projectFeedName: string) { + return this.pathTemplates.projectFeedPathTemplate.match(projectFeedName).feed; + } + + /** + * Return a fully-qualified servicePerimeter resource name string. + * + * @param {string} access_policy + * @param {string} service_perimeter + * @returns {string} Resource name string. + */ + servicePerimeterPath(accessPolicy:string,servicePerimeter:string) { + return this.pathTemplates.servicePerimeterPathTemplate.render({ + access_policy: accessPolicy, + service_perimeter: servicePerimeter, + }); + } + + /** + * Parse the access_policy from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match(servicePerimeterName).access_policy; + } + + /** + * Parse the service_perimeter from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the service_perimeter. + */ + matchServicePerimeterFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match(servicePerimeterName).service_perimeter; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_client_config.json b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_client_config.json new file mode 100644 index 00000000000..aa7547b8a79 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_client_config.json @@ -0,0 +1,51 @@ +{ + "interfaces": { + "google.cloud.asset.v1p2beta1.AssetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateFeed": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFeed": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "ListFeeds": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "UpdateFeed": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFeed": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_proto_list.json b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..d83da645e39 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/asset_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/asset/v1p2beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p2beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" +] diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/gapic_metadata.json new file mode 100644 index 00000000000..5e7034b0ae1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/gapic_metadata.json @@ -0,0 +1,73 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1p2beta1", + "libraryPackage": "@google-cloud/asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "CreateFeed": { + "methods": [ + "createFeed" + ] + }, + "GetFeed": { + "methods": [ + "getFeed" + ] + }, + "ListFeeds": { + "methods": [ + "listFeeds" + ] + }, + "UpdateFeed": { + "methods": [ + "updateFeed" + ] + }, + "DeleteFeed": { + "methods": [ + "deleteFeed" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/index.ts b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/index.ts new file mode 100644 index 00000000000..f87a8e44978 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/src/v1p2beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 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/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..997ccf2219e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const asset = require('@google-cloud/asset'); + +function main() { + const assetServiceClient = new asset.AssetServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..1794fc57ef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AssetServiceClient} from '@google-cloud/asset'; + +// check that the client class type name can be used +function doStuffWithAssetServiceClient(client: AssetServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const assetServiceClient = new AssetServiceClient(); + doStuffWithAssetServiceClient(assetServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/install.ts b/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/test/gapic_asset_service_v1p2beta1.ts b/owl-bot-staging/google-cloud-asset/v1p2beta1/test/gapic_asset_service_v1p2beta1.ts new file mode 100644 index 00000000000..d22d0561e81 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/test/gapic_asset_service_v1p2beta1.ts @@ -0,0 +1,981 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as assetserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1p2beta1.AssetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = assetserviceModule.v1p2beta1.AssetServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = assetserviceModule.v1p2beta1.AssetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new assetserviceModule.v1p2beta1.AssetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = assetserviceModule.v1p2beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p2beta1.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 for the initialized client', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createFeed', () => { + it('invokes createFeed without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.CreateFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.createFeed = stubSimpleCall(expectedResponse); + const [response] = await client.createFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFeed without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.CreateFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.createFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFeed( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1p2beta1.IFeed|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFeed with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.CreateFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.createFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createFeed with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.CreateFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.CreateFeedRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFeed(request), expectedError); + }); + }); + + describe('getFeed', () => { + it('invokes getFeed without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.getFeed = stubSimpleCall(expectedResponse); + const [response] = await client.getFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFeed without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.getFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFeed( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1p2beta1.IFeed|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFeed with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFeed with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.GetFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.GetFeedRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFeed(request), expectedError); + }); + }); + + describe('listFeeds', () => { + it('invokes listFeeds without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() + ); + client.innerApiCalls.listFeeds = stubSimpleCall(expectedResponse); + const [response] = await client.listFeeds(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFeeds without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() + ); + client.innerApiCalls.listFeeds = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFeeds( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1p2beta1.IListFeedsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFeeds with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFeeds(request), expectedError); + const actualRequest = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listFeeds as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listFeeds with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.ListFeedsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.ListFeedsRequest', ['parent']); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listFeeds(request), expectedError); + }); + }); + + describe('updateFeed', () => { + it('invokes updateFeed without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() + ); + request.feed ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.UpdateFeedRequest', ['feed', 'name']); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.updateFeed = stubSimpleCall(expectedResponse); + const [response] = await client.updateFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeed without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() + ); + request.feed ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.UpdateFeedRequest', ['feed', 'name']); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.Feed() + ); + client.innerApiCalls.updateFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFeed( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1p2beta1.IFeed|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeed with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() + ); + request.feed ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.UpdateFeedRequest', ['feed', 'name']); + request.feed.name = defaultValue1; + const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.updateFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeed with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.UpdateFeedRequest() + ); + request.feed ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.UpdateFeedRequest', ['feed', 'name']); + request.feed.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateFeed(request), expectedError); + }); + }); + + describe('deleteFeed', () => { + it('invokes deleteFeed without error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFeed = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFeed(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeed without error using callback', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFeed = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFeed( + request, + (err?: Error|null, result?: protos.google.protobuf.IEmpty|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeed with error', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFeed = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.deleteFeed(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteFeed as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFeed with closed client', async () => { + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p2beta1.DeleteFeedRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p2beta1.DeleteFeedRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteFeed(request), expectedError); + }); + }); + + describe('Path templates', () => { + + describe('accessLevel', () => { + const fakePath = "/rendered/path/accessLevel"; + const expectedParameters = { + access_policy: "accessPolicyValue", + access_level: "accessLevelValue", + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessLevelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accessLevelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accessLevelPath', () => { + const result = client.accessLevelPath("accessPolicyValue", "accessLevelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accessLevelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromAccessLevelName', () => { + const result = client.matchAccessPolicyFromAccessLevelName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccessLevelFromAccessLevelName', () => { + const result = client.matchAccessLevelFromAccessLevelName(fakePath); + assert.strictEqual(result, "accessLevelValue"); + assert((client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('accessPolicy', () => { + const fakePath = "/rendered/path/accessPolicy"; + const expectedParameters = { + access_policy: "accessPolicyValue", + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accessPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accessPolicyPath', () => { + const result = client.accessPolicyPath("accessPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accessPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromAccessPolicyName', () => { + const result = client.matchAccessPolicyFromAccessPolicyName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.accessPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('folderFeed', () => { + const fakePath = "/rendered/path/folderFeed"; + const expectedParameters = { + folder: "folderValue", + feed: "feedValue", + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderFeedPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderFeedPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderFeedPath', () => { + const result = client.folderFeedPath("folderValue", "feedValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.folderFeedPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchFolderFromFolderFeedName', () => { + const result = client.matchFolderFromFolderFeedName(fakePath); + assert.strictEqual(result, "folderValue"); + assert((client.pathTemplates.folderFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeedFromFolderFeedName', () => { + const result = client.matchFeedFromFolderFeedName(fakePath); + assert.strictEqual(result, "feedValue"); + assert((client.pathTemplates.folderFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('organizationFeed', () => { + const fakePath = "/rendered/path/organizationFeed"; + const expectedParameters = { + organization: "organizationValue", + feed: "feedValue", + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationFeedPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationFeedPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationFeedPath', () => { + const result = client.organizationFeedPath("organizationValue", "feedValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.organizationFeedPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchOrganizationFromOrganizationFeedName', () => { + const result = client.matchOrganizationFromOrganizationFeedName(fakePath); + assert.strictEqual(result, "organizationValue"); + assert((client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeedFromOrganizationFeedName', () => { + const result = client.matchFeedFromOrganizationFeedName(fakePath); + assert.strictEqual(result, "feedValue"); + assert((client.pathTemplates.organizationFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('projectFeed', () => { + const fakePath = "/rendered/path/projectFeed"; + const expectedParameters = { + project: "projectValue", + feed: "feedValue", + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectFeedPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectFeedPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectFeedPath', () => { + const result = client.projectFeedPath("projectValue", "feedValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.projectFeedPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromProjectFeedName', () => { + const result = client.matchProjectFromProjectFeedName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.projectFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchFeedFromProjectFeedName', () => { + const result = client.matchFeedFromProjectFeedName(fakePath); + assert.strictEqual(result, "feedValue"); + assert((client.pathTemplates.projectFeedPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('servicePerimeter', () => { + const fakePath = "/rendered/path/servicePerimeter"; + const expectedParameters = { + access_policy: "accessPolicyValue", + service_perimeter: "servicePerimeterValue", + }; + const client = new assetserviceModule.v1p2beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servicePerimeterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePerimeterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePerimeterPath', () => { + const result = client.servicePerimeterPath("accessPolicyValue", "servicePerimeterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePerimeterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromServicePerimeterName', () => { + const result = client.matchAccessPolicyFromServicePerimeterName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServicePerimeterFromServicePerimeterName', () => { + const result = client.matchServicePerimeterFromServicePerimeterName(fakePath); + assert.strictEqual(result, "servicePerimeterValue"); + assert((client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/tsconfig.json b/owl-bot-staging/google-cloud-asset/v1p2beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1p2beta1/webpack.config.js b/owl-bot-staging/google-cloud-asset/v1p2beta1/webpack.config.js new file mode 100644 index 00000000000..9d42a74b844 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p2beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AssetService', + filename: './asset-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/.eslintignore b/owl-bot-staging/google-cloud-asset/v1p5beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/.eslintrc.json b/owl-bot-staging/google-cloud-asset/v1p5beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/.gitignore b/owl-bot-staging/google-cloud-asset/v1p5beta1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/.jsdoc.js b/owl-bot-staging/google-cloud-asset/v1p5beta1/.jsdoc.js new file mode 100644 index 00000000000..f4c5bcc9704 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: 'asset', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/.mocharc.js b/owl-bot-staging/google-cloud-asset/v1p5beta1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/.prettierrc.js b/owl-bot-staging/google-cloud-asset/v1p5beta1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/README.md b/owl-bot-staging/google-cloud-asset/v1p5beta1/README.md new file mode 100644 index 00000000000..b35f3a5e22b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/README.md @@ -0,0 +1 @@ +Asset: Nodejs Client diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/package.json b/owl-bot-staging/google-cloud-asset/v1p5beta1/package.json new file mode 100644 index 00000000000..441b81c39b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/package.json @@ -0,0 +1,58 @@ +{ + "name": "asset", + "version": "0.1.0", + "description": "Asset client for Node.js", + "repository": "googleapis/nodejs-asset", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google asset", + "asset", + "asset service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/asset/v1p5beta1/asset_service.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/asset/v1p5beta1/asset_service.proto new file mode 100644 index 00000000000..2e65fe1a70c --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/asset/v1p5beta1/asset_service.proto @@ -0,0 +1,133 @@ +// Copyright 2024 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.v1p5beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/asset/v1p5beta1/assets.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P5Beta1"; +option go_package = "cloud.google.com/go/asset/apiv1p5beta1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p5beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p5beta1"; + +// 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"; + + // Lists assets with time and resource types and returns paged results in + // response. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1p5beta1/{parent=*/*}/assets" + }; + option (google.api.method_signature) = "parent"; + } +} + +// ListAssets request. +message ListAssetsRequest { + // Required. Name of the organization or project the assets belong to. Format: + // "organizations/[organization-number]" (such as "organizations/123"), + // "projects/[project-id]" (such as "projects/my-project-id"), or + // "projects/[project-number]" (such as "projects/12345"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between the current time and the current time minus 35 days (inclusive). + // If not specified, the current time will be used. Due to delays in resource + // data collection and indexing, there is a volatile window during which + // running the same query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types to take a snapshot for. For example: + // "compute.googleapis.com/Disk". + // + // Regular expression is also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + // + // If specified, only matching assets will be returned, otherwise, it will + // snapshot all asset types. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will + // be returned. + ContentType content_type = 4; + + // The maximum number of assets to be returned in a single response. Default + // is 100, minimum is 1, and maximum is 1000. + int32 page_size = 5; + + // The `next_page_token` returned from the previous `ListAssetsResponse`, or + // unspecified for the first `ListAssetsRequest`. It is a continuation of a + // prior `ListAssets` call, and the API should return the next page of assets. + string page_token = 6; +} + +// ListAssets response. +message ListAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Assets. + repeated Asset assets = 2; + + // Token to retrieve the next page of results. It expires 72 hours after the + // page token for the first page is generated. Set to empty if there are no + // remaining results. + string next_page_token = 3; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; + + // The organization policy set on an asset. + ORG_POLICY = 4; + + // The Access Context Manager policy set on an asset. + ACCESS_POLICY = 5; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/asset/v1p5beta1/assets.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/asset/v1p5beta1/assets.proto new file mode 100644 index 00000000000..1e91313fdb7 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/asset/v1p5beta1/assets.proto @@ -0,0 +1,155 @@ +// Copyright 2024 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.v1p5beta1; + +import "google/api/resource.proto"; +import "google/cloud/orgpolicy/v1/orgpolicy.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1p5Beta1"; +option go_package = "cloud.google.com/go/asset/apiv1p5beta1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p5beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p5beta1"; + +// An asset in Google Cloud. An asset can be any resource in the Google Cloud +// [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // A representation of the resource. + Resource resource = 3; + + // A representation of the IAM policy set on a Google Cloud resource. + // There can be a maximum of one IAM policy set on any given resource. + // In addition, IAM policies inherit their granted access scope from any + // policies set on parent resources in the resource hierarchy. Therefore, the + // effectively policy is the union of both the policy set on this resource + // and each policy set on all of the resource's ancestry resource levels in + // the hierarchy. See + // [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + // for more information. + google.iam.v1.Policy iam_policy = 4; + + // A representation of an [organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + // There can be more than one organization policy with different constraints + // set on a given resource. + repeated google.cloud.orgpolicy.v1.Policy org_policy = 6; + + // A representation of an [access + // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + oneof access_context_policy { + // Please also refer to the [access policy user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + + // Please also refer to the [access level user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). + google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + + // Please also refer to the [service perimeter user + // guide](https://cloud.google.com/vpc-service-controls/docs/overview). + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; + } + + // The ancestry path of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. If the asset + // is a project, folder, or organization, the ancestry path starts from the + // asset itself. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 10; +} + +// A representation of a Google Cloud resource. +message Resource { + // The API version. Example: "v1". + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // Example: + // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. Example: + // `Project` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP `GET` request using this + // URL returns the resource itself. Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + // + // This value is unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + // + // For Google Cloud assets, this value is the parent resource defined in the + // [IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // Example: + // `//cloudresourcemanager.googleapis.com/projects/my_project_123` + // + // For third-party assets, this field may be set differently. + string parent = 5; + + // The content of the resource, in which some sensitive fields are removed + // and may not be present. + google.protobuf.Struct data = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto new file mode 100644 index 00000000000..10fe86a216e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto @@ -0,0 +1,313 @@ +// Copyright 2024 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.orgpolicy.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OrgPolicy.V1"; +option go_package = "cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyProto"; +option java_package = "com.google.cloud.orgpolicy.v1"; +option php_namespace = "Google\\Cloud\\OrgPolicy\\V1"; +option ruby_package = "Google::Cloud::OrgPolicy::V1"; + +// Defines a Cloud Organization `Policy` which is used to specify `Constraints` +// for configurations of Cloud Platform resources. +message Policy { + // Used in `policy_type` to specify how `list_policy` behaves at this + // resource. + // + // `ListPolicy` can define specific values and subtrees of Cloud Resource + // Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that + // are allowed or denied by setting the `allowed_values` and `denied_values` + // fields. This is achieved by using the `under:` and optional `is:` prefixes. + // The `under:` prefix is used to denote resource subtree values. + // The `is:` prefix is used to denote specific values, and is required only + // if the value contains a ":". Values prefixed with "is:" are treated the + // same as values with no prefix. + // Ancestry subtrees must be in one of the following formats: + // - "projects/", e.g. "projects/tokyo-rain-123" + // - "folders/", e.g. "folders/1234" + // - "organizations/", e.g. "organizations/1234" + // The `supports_under` field of the associated `Constraint` defines whether + // ancestry prefixes can be used. You can set `allowed_values` and + // `denied_values` in the same `Policy` if `all_values` is + // `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all + // values. If `all_values` is set to either `ALLOW` or `DENY`, + // `allowed_values` and `denied_values` must be unset. + message ListPolicy { + // This enum can be used to set `Policies` that apply to all possible + // configuration values rather than specific values in `allowed_values` or + // `denied_values`. + // + // Settting this to `ALLOW` will mean this `Policy` allows all values. + // Similarly, setting it to `DENY` will mean no values are allowed. If + // set to either `ALLOW` or `DENY, `allowed_values` and `denied_values` + // must be unset. Setting this to `ALL_VALUES_UNSPECIFIED` allows for + // setting `allowed_values` and `denied_values`. + enum AllValues { + // Indicates that allowed_values or denied_values must be set. + ALL_VALUES_UNSPECIFIED = 0; + + // A policy with this set allows all values. + ALLOW = 1; + + // A policy with this set denies all values. + DENY = 2; + } + + // List of values allowed at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string allowed_values = 1; + + // List of values denied at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string denied_values = 2; + + // The policy all_values state. + AllValues all_values = 3; + + // Optional. The Google Cloud Console will try to default to a configuration + // that matches the value specified in this `Policy`. If `suggested_value` + // is not set, it will inherit the value specified higher in the hierarchy, + // unless `inherit_from_parent` is `false`. + string suggested_value = 4; + + // Determines the inheritance behavior for this `Policy`. + // + // By default, a `ListPolicy` set at a resource supercedes any `Policy` set + // anywhere up the resource hierarchy. However, if `inherit_from_parent` is + // set to `true`, then the values from the effective `Policy` of the parent + // resource are inherited, meaning the values set in this `Policy` are + // added to the values inherited up the hierarchy. + // + // Setting `Policy` hierarchies that inherit both allowed values and denied + // values isn't recommended in most circumstances to keep the configuration + // simple and understandable. However, it is possible to set a `Policy` with + // `allowed_values` set that inherits a `Policy` with `denied_values` set. + // In this case, the values that are allowed must be in `allowed_values` and + // not present in `denied_values`. + // + // For example, suppose you have a `Constraint` + // `constraints/serviceuser.services`, which has a `constraint_type` of + // `list_constraint`, and with `constraint_default` set to `ALLOW`. + // Suppose that at the Organization level, a `Policy` is applied that + // restricts the allowed API activations to {`E1`, `E2`}. Then, if a + // `Policy` is applied to a project below the Organization that has + // `inherit_from_parent` set to `false` and field all_values set to DENY, + // then an attempt to activate any API will be denied. + // + // The following examples demonstrate different possible layerings for + // `projects/bar` parented by `organizations/foo`: + // + // Example 1 (no inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has `inherit_from_parent` `false` and values: + // {allowed_values: "E3" allowed_values: "E4"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E3`, and `E4`. + // + // Example 2 (inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {value: "E3" value: "E4" inherit_from_parent: true} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. + // + // Example 3 (inheriting both allowed and denied values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {denied_values: "E1"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The value accepted at `projects/bar` is `E2`. + // + // Example 4 (RestoreDefault): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {RestoreDefault: {}} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 5 (no policy inherits parent policy): + // `organizations/foo` has no `Policy` set. + // `projects/bar` has no `Policy` set. + // The accepted values at both levels are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 6 (ListConstraint allowing all): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: ALLOW} + // The accepted values at `organizations/foo` are `E1`, E2`. + // Any value is accepted at `projects/bar`. + // + // Example 7 (ListConstraint allowing none): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: DENY} + // The accepted values at `organizations/foo` are `E1`, E2`. + // No value is accepted at `projects/bar`. + // + // Example 10 (allowed and denied subtrees of Resource Manager hierarchy): + // Given the following resource hierarchy + // O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "under:organizations/O1"} + // `projects/bar` has a `Policy` with: + // {allowed_values: "under:projects/P3"} + // {denied_values: "under:folders/F2"} + // The accepted values at `organizations/foo` are `organizations/O1`, + // `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`, + // `projects/P3`. + // The accepted values at `projects/bar` are `organizations/O1`, + // `folders/F1`, `projects/P1`. + bool inherit_from_parent = 5; + } + + // Used in `policy_type` to specify how `boolean_policy` will behave at this + // resource. + message BooleanPolicy { + // If `true`, then the `Policy` is enforced. If `false`, then any + // configuration is acceptable. + // + // Suppose you have a `Constraint` + // `constraints/compute.disableSerialPortAccess` with `constraint_default` + // set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following + // behavior: + // - If the `Policy` at this resource has enforced set to `false`, serial + // port connection attempts will be allowed. + // - If the `Policy` at this resource has enforced set to `true`, serial + // port connection attempts will be refused. + // - If the `Policy` at this resource is `RestoreDefault`, serial port + // connection attempts will be allowed. + // - If no `Policy` is set at this resource or anywhere higher in the + // resource hierarchy, serial port connection attempts will be allowed. + // - If no `Policy` is set at this resource, but one exists higher in the + // resource hierarchy, the behavior is as if the`Policy` were set at + // this resource. + // + // The following examples demonstrate the different possible layerings: + // + // Example 1 (nearest `Constraint` wins): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has no `Policy` set. + // The constraint at `projects/bar` and `organizations/foo` will not be + // enforced. + // + // Example 2 (enforcement gets replaced): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has a `Policy` with: + // {enforced: true} + // The constraint at `organizations/foo` is not enforced. + // The constraint at `projects/bar` is enforced. + // + // Example 3 (RestoreDefault): + // `organizations/foo` has a `Policy` with: + // {enforced: true} + // `projects/bar` has a `Policy` with: + // {RestoreDefault: {}} + // The constraint at `organizations/foo` is enforced. + // The constraint at `projects/bar` is not enforced, because + // `constraint_default` for the `Constraint` is `ALLOW`. + bool enforced = 1; + } + + // Ignores policies set above this resource and restores the + // `constraint_default` enforcement behavior of the specific `Constraint` at + // this resource. + // + // Suppose that `constraint_default` is set to `ALLOW` for the + // `Constraint` `constraints/serviceuser.services`. Suppose that organization + // foo.com sets a `Policy` at their Organization resource node that restricts + // the allowed service activations to deny all service activations. They + // could then set a `Policy` with the `policy_type` `restore_default` on + // several experimental projects, restoring the `constraint_default` + // enforcement of the `Constraint` for only those projects, allowing those + // projects to have all services activated. + message RestoreDefault { + + } + + // Version of the `Policy`. Default version is 0; + int32 version = 1; + + // The name of the `Constraint` the `Policy` is configuring, for example, + // `constraints/serviceuser.services`. + // + // Immutable after creation. + string constraint = 2; + + // An opaque tag indicating the current version of the `Policy`, used for + // concurrency control. + // + // When the `Policy` is returned from either a `GetPolicy` or a + // `ListOrgPolicy` request, this `etag` indicates the version of the current + // `Policy` to use when executing a read-modify-write loop. + // + // When the `Policy` is returned from a `GetEffectivePolicy` request, the + // `etag` will be unset. + // + // When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value + // that was returned from a `GetOrgPolicy` request as part of a + // read-modify-write loop for concurrency control. Not setting the `etag`in a + // `SetOrgPolicy` request will result in an unconditional write of the + // `Policy`. + bytes etag = 3; + + // The time stamp the `Policy` was previously updated. This is set by the + // server, not specified by the caller, and represents the last time a call to + // `SetOrgPolicy` was made for that `Policy`. Any value set by the client will + // be ignored. + google.protobuf.Timestamp update_time = 4; + + // The field to populate is based on the `constraint_type` value in the + // `Constraint`. + // `list_constraint` => `list_policy` + // `boolean_constraint` => `boolean_policy` + // + // A `restore_default` message may be used with any `Constraint` type. + // + // Providing a *_policy that is incompatible with the `constraint_type` will + // result in an `invalid_argument` error. + // + // Attempting to set a `Policy` with a `policy_type` not set will result in an + // `invalid_argument` error. + oneof policy_type { + // List of values either allowed or disallowed. + ListPolicy list_policy = 5; + + // For boolean `Constraints`, whether to enforce the `Constraint` or not. + BooleanPolicy boolean_policy = 6; + + // Restores the default behavior of the constraint; independent of + // `Constraint` type. + RestoreDefault restore_default = 7; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/inventory.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/inventory.proto new file mode 100644 index 00000000000..96e0b23f880 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/inventory.proto @@ -0,0 +1,384 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "Inventories"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS Config Inventory is a service for collecting and reporting operating +// system and package information on VM instances. + +// This API resource represents the available inventory data for a +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// You can use this API resource to determine the inventory data of your VM. +// +// For more information, see [Information provided by OS inventory +// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). +message Inventory { + option (google.api.resource) = { + type: "osconfig.googleapis.com/Inventory" + pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory" + }; + + // Operating system information for the VM. + message OsInfo { + // The VM hostname. + string hostname = 9; + + // The operating system long name. + // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019 + // Datacenter'. + string long_name = 2; + + // The operating system short name. + // For example, 'windows' or 'debian'. + string short_name = 3; + + // The version of the operating system. + string version = 4; + + // The system architecture of the operating system. + string architecture = 5; + + // The kernel version of the operating system. + string kernel_version = 6; + + // The kernel release of the operating system. + string kernel_release = 7; + + // The current version of the OS Config agent running on the VM. + string osconfig_agent_version = 8; + } + + // A single piece of inventory on a VM. + message Item { + // The origin of a specific inventory item. + enum OriginType { + // Invalid. An origin type must be specified. + ORIGIN_TYPE_UNSPECIFIED = 0; + + // This inventory item was discovered as the result of the agent + // reporting inventory via the reporting API. + INVENTORY_REPORT = 1; + } + + // The different types of inventory that are tracked on a VM. + enum Type { + // Invalid. An type must be specified. + TYPE_UNSPECIFIED = 0; + + // This represents a package that is installed on the VM. + INSTALLED_PACKAGE = 1; + + // This represents an update that is available for a package. + AVAILABLE_PACKAGE = 2; + } + + // Identifier for this item, unique across items for this VM. + string id = 1; + + // The origin of this inventory item. + OriginType origin_type = 2; + + // When this inventory item was first detected. + google.protobuf.Timestamp create_time = 8; + + // When this inventory item was last modified. + google.protobuf.Timestamp update_time = 9; + + // The specific type of inventory, correlating to its specific details. + Type type = 5; + + // Specific details of this inventory item based on its type. + oneof details { + // Software package present on the VM instance. + SoftwarePackage installed_package = 6; + + // Software package available to be installed on the VM instance. + SoftwarePackage available_package = 7; + } + } + + // Software package information of the operating system. + message SoftwarePackage { + // Information about the different types of software packages. + oneof details { + // Yum package info. + // For details about the yum package manager, see + // https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum. + VersionedPackage yum_package = 1; + + // Details of an APT package. + // For details about the apt package manager, see + // https://wiki.debian.org/Apt. + VersionedPackage apt_package = 2; + + // Details of a Zypper package. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + VersionedPackage zypper_package = 3; + + // Details of a Googet package. + // For details about the googet package manager, see + // https://github.com/google/googet. + VersionedPackage googet_package = 4; + + // Details of a Zypper patch. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + ZypperPatch zypper_patch = 5; + + // Details of a Windows Update package. + // See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for + // information about Windows Update. + WindowsUpdatePackage wua_package = 6; + + // Details of a Windows Quick Fix engineering package. + // See + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + // for info in Windows Quick Fix Engineering. + WindowsQuickFixEngineeringPackage qfe_package = 7; + + // Details of a COS package. + VersionedPackage cos_package = 8; + + // Details of Windows Application. + WindowsApplication windows_application = 9; + } + } + + // Information related to the a standard versioned package. This includes + // package info for APT, Yum, Zypper, and Googet package managers. + message VersionedPackage { + // The name of the package. + string package_name = 4; + + // The system architecture this package is intended for. + string architecture = 2; + + // The version of the package. + string version = 3; + } + + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + + // Details related to a Windows Update package. + // Field data and names are taken from Windows Update API IUpdate Interface: + // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ + // Descriptive fields like title, and description are localized based on + // the locale of the VM being updated. + message WindowsUpdatePackage { + // Categories specified by the Windows Update. + message WindowsUpdateCategory { + // The identifier of the windows update category. + string id = 1; + + // The name of the windows update category. + string name = 2; + } + + // The localized title of the update package. + string title = 1; + + // The localized description of the update package. + string description = 2; + + // The categories that are associated with this update package. + repeated WindowsUpdateCategory categories = 3; + + // A collection of Microsoft Knowledge Base article IDs that are associated + // with the update package. + repeated string kb_article_ids = 4; + + // A hyperlink to the language-specific support information for the update. + string support_url = 11; + + // A collection of URLs that provide more information about the update + // package. + repeated string more_info_urls = 5; + + // Gets the identifier of an update package. Stays the same across + // revisions. + string update_id = 6; + + // The revision number of this update package. + int32 revision_number = 7; + + // The last published date of the update, in (UTC) date and time. + google.protobuf.Timestamp last_deployment_change_time = 10; + } + + // Information related to a Quick Fix Engineering package. + // Fields are taken from Windows QuickFixEngineering Interface and match + // the source names: + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + message WindowsQuickFixEngineeringPackage { + // A short textual description of the QFE update. + string caption = 1; + + // A textual description of the QFE update. + string description = 2; + + // Unique identifier associated with a particular QFE update. + string hot_fix_id = 3; + + // Date that the QFE update was installed. Mapped from installed_on field. + google.protobuf.Timestamp install_time = 5; + } + + // Contains information about a Windows application that is retrieved from the + // Windows Registry. For more information about these fields, see: + // https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key + message WindowsApplication { + // The name of the application or product. + string display_name = 1; + + // The version of the product or application in string format. + string display_version = 2; + + // The name of the manufacturer for the product or application. + string publisher = 3; + + // The last time this product received service. The value of this property + // is replaced each time a patch is applied or removed from the product or + // the command-line option is used to repair the product. + google.type.Date install_date = 4; + + // The internet address for technical support. + string help_link = 5; + } + + // Output only. The `Inventory` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Base level operating system information for the VM. + OsInfo os_info = 1; + + // Inventory items related to the VM keyed by an opaque unique identifier for + // each inventory item. The identifier is unique to each distinct and + // addressable inventory item and will change, when there is a new package + // version. + map items = 2; + + // Output only. Timestamp of the last reported inventory for the VM. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting inventory data for the specified VM. +message GetInventoryRequest { + // Required. API resource name for inventory resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/inventory` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/Inventory" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; +} + +// A request message for listing inventory data for all VMs in the specified +// location. +message ListInventoriesRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; + + // The maximum number of results to return. + int32 page_size = 3; + + // A pagination token returned from a previous call to + // `ListInventories` that indicates where this listing + // should continue from. + string page_token = 4; + + // If provided, this field specifies the criteria that must be met by a + // `Inventory` API resource to be included in the response. + string filter = 5; +} + +// A response message for listing inventory data for all VMs in a specified +// location. +message ListInventoriesResponse { + // List of inventory objects. + repeated Inventory inventories = 1; + + // The pagination token to retrieve the next page of inventory objects. + string next_page_token = 2; +} + +// The view for inventory objects. +enum InventoryView { + // The default value. + // The API defaults to the BASIC view. + INVENTORY_VIEW_UNSPECIFIED = 0; + + // Returns the basic inventory information that includes `os_info`. + BASIC = 1; + + // Returns all fields. + FULL = 2; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy.proto new file mode 100644 index 00000000000..b67eb9c6f99 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy.proto @@ -0,0 +1,548 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// An OS policy defines the desired state configuration for a VM. +message OSPolicy { + // Policy mode + enum Mode { + // Invalid mode + MODE_UNSPECIFIED = 0; + + // This mode checks if the configuration resources in the policy are in + // their desired state. No actions are performed if they are not in the + // desired state. This mode is used for reporting purposes. + VALIDATION = 1; + + // This mode checks if the configuration resources in the policy are in + // their desired state, and if not, enforces the desired state. + ENFORCEMENT = 2; + } + + // Filtering criteria to select VMs based on inventory details. + message InventoryFilter { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // An OS policy resource is used to define the desired state configuration + // and provides a specific functionality like installing/removing packages, + // executing a script etc. + // + // The system ensures that resources are always in their desired state by + // taking necessary actions if they have drifted from their desired state. + message Resource { + // A remote or local file. + message File { + // Specifies a file available via some URI. + message Remote { + // Required. URI from which to fetch the object. It should contain both + // the protocol and path following the format `{protocol}://{location}`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // SHA256 checksum of the remote file. + string sha256_checksum = 2; + } + + // Specifies a file available as a Cloud Storage Object. + message Gcs { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Generation number of the Cloud Storage object. + int64 generation = 3; + } + + // A specific type of file. + oneof type { + // A generic remote file. + Remote remote = 1; + + // A Cloud Storage object. + Gcs gcs = 2; + + // A local path within the VM to use. + string local_path = 3; + } + + // Defaults to false. When false, files are subject to validations + // based on the file type: + // + // Remote: A checksum must be specified. + // Cloud Storage: An object generation number must be specified. + bool allow_insecure = 4; + } + + // A resource that manages a system package. + message PackageResource { + // The desired state that the OS Config agent maintains on the VM. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure that the package is installed. + INSTALLED = 1; + + // The agent ensures that the package is not installed and + // uninstalls it if detected. + REMOVED = 2; + } + + // A deb package file. dpkg packages only support INSTALLED state. + message Deb { + // Required. A deb package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `dpkg -i package` + // - install when true: `apt-get update && apt-get -y install + // package.deb` + bool pull_deps = 2; + } + + // A package managed by APT. + // - install: `apt-get update && apt-get -y install [name]` + // - remove: `apt-get -y remove [name]` + message APT { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An RPM package file. RPM packages only support INSTALLED state. + message RPM { + // Required. An rpm package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `rpm --upgrade --replacepkgs package.rpm` + // - install when true: `yum -y install package.rpm` or + // `zypper -y install package.rpm` + bool pull_deps = 2; + } + + // A package managed by YUM. + // - install: `yum -y install package` + // - remove: `yum -y remove package` + message YUM { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by Zypper. + // - install: `zypper -y install package` + // - remove: `zypper -y rm package` + message Zypper { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by GooGet. + // - install: `googet -noconfirm install package` + // - remove: `googet -noconfirm remove package` + message GooGet { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An MSI package. MSI packages only support INSTALLED state. + message MSI { + // Required. The MSI package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Additional properties to use during installation. + // This should be in the format of Property=Setting. + // Appended to the defaults of `ACTION=INSTALL + // REBOOT=ReallySuppress`. + repeated string properties = 2; + } + + // Required. The desired state the agent should maintain for this package. + DesiredState desired_state = 1 [(google.api.field_behavior) = REQUIRED]; + + // A system package. + oneof system_package { + // A package managed by Apt. + APT apt = 2; + + // A deb package file. + Deb deb = 3; + + // A package managed by YUM. + YUM yum = 4; + + // A package managed by Zypper. + Zypper zypper = 5; + + // An rpm package file. + RPM rpm = 6; + + // A package managed by GooGet. + GooGet googet = 7; + + // An MSI package. + MSI msi = 8; + } + } + + // A resource that manages a package repository. + message RepositoryResource { + // Represents a single apt package repository. These will be added to + // a repo file that will be managed at + // `/etc/apt/sources.list.d/google_osconfig.list`. + message AptRepository { + // Type of archive. + enum ArchiveType { + // Unspecified is invalid. + ARCHIVE_TYPE_UNSPECIFIED = 0; + + // Deb indicates that the archive contains binary files. + DEB = 1; + + // Deb-src indicates that the archive contains source files. + DEB_SRC = 2; + } + + // Required. Type of archive files in this repository. + ArchiveType archive_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URI for this repository. + string uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Distribution of this repository. + string distribution = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of components for this repository. Must contain at + // least one item. + repeated string components = 4 [(google.api.field_behavior) = REQUIRED]; + + // URI of the key file for this repository. The agent maintains a + // keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg`. + string gpg_key = 5; + } + + // Represents a single yum package repository. These are added to a + // repo file that is managed at + // `/etc/yum.repos.d/google_osconfig.repo`. + message YumRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the yum config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for resource conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a single zypper package repository. These are added to a + // repo file that is managed at + // `/etc/zypp/repos.d/google_osconfig.repo`. + message ZypperRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the zypper config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for GuestPolicy conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a Goo package repository. These are added to a repo file + // that is managed at + // `C:/ProgramData/GooGet/repos/google_osconfig.repo`. + message GooRepository { + // Required. The name of the repository. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The url of the repository. + string url = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A specific type of repository. + oneof repository { + // An Apt Repository. + AptRepository apt = 1; + + // A Yum Repository. + YumRepository yum = 2; + + // A Zypper Repository. + ZypperRepository zypper = 3; + + // A Goo Repository. + GooRepository goo = 4; + } + } + + // A resource that allows executing scripts on the VM. + // + // The `ExecResource` has 2 stages: `validate` and `enforce` and both stages + // accept a script as an argument to execute. + // + // When the `ExecResource` is applied by the agent, it first executes the + // script in the `validate` stage. The `validate` stage can signal that the + // `ExecResource` is already in the desired state by returning an exit code + // of `100`. If the `ExecResource` is not in the desired state, it should + // return an exit code of `101`. Any other exit code returned by this stage + // is considered an error. + // + // If the `ExecResource` is not in the desired state based on the exit code + // from the `validate` stage, the agent proceeds to execute the script from + // the `enforce` stage. If the `ExecResource` is already in the desired + // state, the `enforce` stage will not be run. + // Similar to `validate` stage, the `enforce` stage should return an exit + // code of `100` to indicate that the resource in now in its desired state. + // Any other exit code is considered an error. + // + // NOTE: An exit code of `100` was chosen over `0` (and `101` vs `1`) to + // have an explicit indicator of `in desired state`, `not in desired state` + // and errors. Because, for example, Powershell will always return an exit + // code of `0` unless an `exit` statement is provided in the script. So, for + // reasons of consistency and being explicit, exit codes `100` and `101` + // were chosen. + message ExecResource { + // A file or script to execute. + message Exec { + // The interpreter to use. + enum Interpreter { + // Invalid value, the request will return validation error. + INTERPRETER_UNSPECIFIED = 0; + + // If an interpreter is not specified, the + // source is executed directly. This execution, without an + // interpreter, only succeeds for executables and scripts that have shebang lines. + NONE = 1; + + // Indicates that the script runs with `/bin/sh` on Linux and + // `cmd.exe` on Windows. + SHELL = 2; + + // Indicates that the script runs with PowerShell. + POWERSHELL = 3; + } + + // What to execute. + oneof source { + // A remote or local file. + File file = 1; + + // An inline script. + // The size of the script is limited to 1024 characters. + string script = 2; + } + + // Optional arguments to pass to the source during execution. + repeated string args = 3; + + // Required. The script interpreter to use. + Interpreter interpreter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Only recorded for enforce Exec. + // Path to an output file (that is created by this Exec) whose + // content will be recorded in OSPolicyResourceCompliance after a + // successful run. Absence or failure to read this file will result in + // this ExecResource being non-compliant. Output file size is limited to + // 100K bytes. + string output_file_path = 5; + } + + // Required. What to run to validate this resource is in the desired + // state. An exit code of 100 indicates "in desired state", and exit code + // of 101 indicates "not in desired state". Any other exit code indicates + // a failure running validate. + Exec validate = 1 [(google.api.field_behavior) = REQUIRED]; + + // What to run to bring this resource into the desired state. + // An exit code of 100 indicates "success", any other exit code indicates + // a failure running enforce. + Exec enforce = 2; + } + + // A resource that manages the state of a file. + message FileResource { + // Desired state of the file. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure file at path is present. + PRESENT = 1; + + // Ensure file at path is absent. + ABSENT = 2; + + // Ensure the contents of the file at path matches. If the file does + // not exist it will be created. + CONTENTS_MATCH = 3; + } + + // The source for the contents of the file. + oneof source { + // A remote or local source. + File file = 1; + + // A a file with this content. + // The size of the content is limited to 1024 characters. + string content = 2; + } + + // Required. The absolute path of the file within the VM. + string path = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Desired state of the file. + DesiredState state = 4 [(google.api.field_behavior) = REQUIRED]; + + // Consists of three octal digits which represent, in + // order, the permissions of the owner, group, and other users for the + // file (similarly to the numeric mode used in the linux chmod + // utility). Each digit represents a three bit number with the 4 bit + // corresponding to the read permissions, the 2 bit corresponds to the + // write bit, and the one bit corresponds to the execute permission. + // Default behavior is 755. + // + // Below are some examples of permissions and their associated values: + // read, write, and execute: 7 + // read and execute: 5 + // read and write: 6 + // read only: 4 + string permissions = 5; + } + + // Required. The id of the resource with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the OS policy. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Resource type. + oneof resource_type { + // Package resource + PackageResource pkg = 2; + + // Package repository resource + RepositoryResource repository = 3; + + // Exec resource + ExecResource exec = 4; + + // File resource + FileResource file = 5; + } + } + + // Resource groups provide a mechanism to group OS policy resources. + // + // Resource groups enable OS policy authors to create a single OS policy + // to be applied to VMs running different operating Systems. + // + // When the OS policy is applied to a target VM, the appropriate resource + // group within the OS policy is selected based on the `OSFilter` specified + // within the resource group. + message ResourceGroup { + // List of inventory filters for the resource group. + // + // The resources in this resource group are applied to the target VM if it + // satisfies at least one of the following inventory filters. + // + // For example, to apply this resource group to VMs running either `RHEL` or + // `CentOS` operating systems, specify 2 items for the list with following + // values: + // inventory_filters[0].os_short_name='rhel' and + // inventory_filters[1].os_short_name='centos' + // + // If the list is empty, this resource group will be applied to the target + // VM unconditionally. + repeated InventoryFilter inventory_filters = 1; + + // Required. List of resources configured for this resource group. + // The resources are executed in the exact order specified here. + repeated Resource resources = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The id of the OS policy with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the assignment. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Policy description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. Policy mode + Mode mode = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of resource groups for the policy. + // For a particular VM, resource groups are evaluated in the order specified + // and the first resource group that is applicable is selected and the rest + // are ignored. + // + // If none of the resource groups are applicable for a VM, the VM is + // considered to be non-compliant w.r.t this policy. This behavior can be + // toggled by the flag `allow_no_resource_group_match` + repeated ResourceGroup resource_groups = 4 + [(google.api.field_behavior) = REQUIRED]; + + // This flag determines the OS policy compliance status when none of the + // resource groups within the policy are applicable for a VM. Set this value + // to `true` if the policy needs to be reported as compliant even if the + // policy has nothing to validate or enforce. + bool allow_no_resource_group_match = 5; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto new file mode 100644 index 00000000000..1a290ee5eca --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto @@ -0,0 +1,296 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OSPolicyAssignmentReportsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}" +}; + +// Get a report of the OS policy assignment for a VM instance. +message GetOSPolicyAssignmentReportRequest { + // Required. API resource name for OS policy assignment report. + // + // Format: + // `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + // For `{assignment_id}`, the OSPolicyAssignment id must be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + } + ]; +} + +// List the OS policy assignment reports for VM instances. +message ListOSPolicyAssignmentReportsRequest { + // Required. The parent resource name. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + // provided. If '-' is provided, the response will include + // OSPolicyAssignmentReports for all instances in the project/location. + // For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + // is provided, the response will include OSPolicyAssignmentReports for all + // OSPolicyAssignments in the project/location. + // Either {instance} or {assignment} must be `-`. + // + // For example: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + // returns all reports for the instance + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + // returns all the reports for the given assignment across all instances. + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + // returns all the reports for all assignments across all instances. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // If provided, this field specifies the criteria that must be met by the + // `OSPolicyAssignmentReport` API resource that is included in the response. + string filter = 3; + + // A pagination token returned from a previous call to the + // `ListOSPolicyAssignmentReports` method that indicates where this listing + // should continue from. + string page_token = 4; +} + +// A response message for listing OS Policy assignment reports including the +// page of results and page token. +message ListOSPolicyAssignmentReportsResponse { + // List of OS policy assignment reports. + repeated OSPolicyAssignmentReport os_policy_assignment_reports = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // report objects. + string next_page_token = 2; +} + +// A report of the OS policy assignment status for a given instance. +message OSPolicyAssignmentReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report" + }; + + // Compliance data for an OS policy + message OSPolicyCompliance { + // Possible compliance states for an os policy. + enum ComplianceState { + // The policy is in an unknown compliance state. + // + // Refer to the field `compliance_state_reason` to learn the exact reason + // for the policy to be in this compliance state. + UNKNOWN = 0; + + // Policy is compliant. + // + // The policy is compliant if all the underlying resources are also + // compliant. + COMPLIANT = 1; + + // Policy is non-compliant. + // + // The policy is non-compliant if one or more underlying resources are + // non-compliant. + NON_COMPLIANT = 2; + } + + // Compliance data for an OS policy resource. + message OSPolicyResourceCompliance { + // Step performed by the OS Config agent for configuring an + // `OSPolicy` resource to its desired state. + message OSPolicyResourceConfigStep { + // Supported configuration step types + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Checks for resource conflicts such as schema errors. + VALIDATION = 1; + + // Checks the current status of the desired state for a resource. + DESIRED_STATE_CHECK = 2; + + // Enforces the desired state for a resource that is not in desired + // state. + DESIRED_STATE_ENFORCEMENT = 3; + + // Re-checks the status of the desired state. This check is done + // for a resource after the enforcement of all OS policies. + // + // This step is used to determine the final desired state status for + // the resource. It accounts for any resources that might have drifted + // from their desired state due to side effects from executing other + // resources. + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4; + } + + // Configuration step type. + Type type = 1; + + // An error message recorded during the execution of this step. + // Only populated if errors were encountered during this step execution. + string error_message = 2; + } + + // Possible compliance states for a resource. + enum ComplianceState { + // The resource is in an unknown compliance state. + // + // To get more details about why the policy is in this state, review + // the output of the `compliance_state_reason` field. + UNKNOWN = 0; + + // Resource is compliant. + COMPLIANT = 1; + + // Resource is non-compliant. + NON_COMPLIANT = 2; + } + + // ExecResource specific output. + message ExecResourceOutput { + // Output from enforcement phase output file (if run). + // Output size is limited to 100K bytes. + bytes enforcement_output = 2; + } + + // The ID of the OS policy resource. + string os_policy_resource_id = 1; + + // Ordered list of configuration completed by the agent for the OS policy + // resource. + repeated OSPolicyResourceConfigStep config_steps = 2; + + // The compliance state of the resource. + ComplianceState compliance_state = 3; + + // A reason for the resource to be in the given compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // The following values are supported when `compliance_state == UNKNOWN` + // + // * `execution-errors`: Errors were encountered by the agent while + // executing the resource and the compliance state couldn't be + // determined. + // * `execution-skipped-by-agent`: Resource execution was skipped by the + // agent because errors were encountered while executing prior resources + // in the OS policy. + // * `os-policy-execution-attempt-failed`: The execution of the OS policy + // containing this resource failed and the compliance state couldn't be + // determined. + string compliance_state_reason = 4; + + // Resource specific output. + oneof output { + // ExecResource specific output. + ExecResourceOutput exec_resource_output = 5; + } + } + + // The OS policy id + string os_policy_id = 1; + + // The compliance state of the OS policy. + ComplianceState compliance_state = 2; + + // The reason for the OS policy to be in an unknown compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // If populated, the field can contain one of the following values: + // + // * `vm-not-running`: The VM was not running. + // * `os-policies-not-supported-by-agent`: The version of the OS Config + // agent running on the VM does not support running OS policies. + // * `no-agent-detected`: The OS Config agent is not detected for the VM. + // * `resource-execution-errors`: The OS Config agent encountered errors + // while executing one or more resources in the policy. See + // `os_policy_resource_compliances` for details. + // * `task-timeout`: The task sent to the agent to apply the policy timed + // out. + // * `unexpected-agent-state`: The OS Config agent did not report the final + // status of the task that attempted to apply the policy. Instead, the agent + // unexpectedly started working on a different task. This mostly happens + // when the agent or VM unexpectedly restarts while applying OS policies. + // * `internal-service-errors`: Internal service errors were encountered + // while attempting to apply the policy. + string compliance_state_reason = 3; + + // Compliance data for each resource within the policy that is applied to + // the VM. + repeated OSPolicyResourceCompliance os_policy_resource_compliances = 4; + } + + // The `OSPolicyAssignmentReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/osPolicyAssignments/{os_policy_assignment_id}/report` + string name = 1; + + // The Compute Engine VM instance name. + string instance = 2; + + // Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` + // belongs to. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 3 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // Compliance data for each `OSPolicy` that is applied to the VM. + repeated OSPolicyCompliance os_policy_compliances = 4; + + // Timestamp for when the report was last generated. + google.protobuf.Timestamp update_time = 5; + + // Unique identifier of the last attempted run to apply the OS policies + // associated with this assignment on the VM. + // + // This ID is logged by the OS Config agent while applying the OS + // policies associated with this assignment on the VM. + // NOTE: If the service is unable to successfully connect to the agent for + // this run, then this id will not be available in the agent logs. + string last_run_id = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto new file mode 100644 index 00000000000..e1bfb7e1fb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto @@ -0,0 +1,386 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/os_policy.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyAssignmentsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS policy assignment is an API resource that is used to +// apply a set of OS policies to a dynamically targeted group of Compute Engine +// VM instances. +// +// An OS policy is used to define the desired state configuration for a +// Compute Engine VM instance through a set of configuration resources that +// provide capabilities such as installing or removing software packages, or +// executing a script. +// +// For more information, see [OS policy and OS policy +// assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies). +message OSPolicyAssignment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}" + }; + + // Message representing label set. + // * A label is a key value pair set for a VM. + // * A LabelSet is a set of labels. + // * Labels within a LabelSet are ANDed. In other words, a LabelSet is + // applicable for a VM only if it matches all the labels in the + // LabelSet. + // * Example: A LabelSet with 2 labels: `env=prod` and `type=webserver` will + // only be applicable for those VMs with both labels + // present. + message LabelSet { + // Labels are identified by key/value pairs in this map. + // A VM should contain all the key/value pairs specified in this + // map to be selected. + map labels = 1; + } + + // Filters to select target VMs for an assignment. + // + // If more than one filter criteria is specified below, a VM will be selected + // if and only if it satisfies all of them. + message InstanceFilter { + // VM inventory details. + message Inventory { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // Target all VMs in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // List of label sets used for VM inclusion. + // + // If the list has more than one `LabelSet`, the VM is included if any + // of the label sets are applicable for the VM. + repeated LabelSet inclusion_labels = 2; + + // List of label sets used for VM exclusion. + // + // If the list has more than one label set, the VM is excluded if any + // of the label sets are applicable for the VM. + repeated LabelSet exclusion_labels = 3; + + // List of inventories to select VMs. + // + // A VM is selected if its inventory data matches at least one of the + // following inventories. + repeated Inventory inventories = 4; + } + + // Message to configure the rollout at the zonal level for the OS policy + // assignment. + message Rollout { + // Required. The maximum number (or percentage) of VMs per zone to disrupt + // at any given moment. + FixedOrPercent disruption_budget = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. This determines the minimum duration of time to wait after the + // configuration changes are applied through the current rollout. A + // VM continues to count towards the `disruption_budget` at least + // until this duration of time has passed after configuration changes are + // applied. + google.protobuf.Duration min_wait_duration = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // OS policy assignment rollout state + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}` + // + // This field is ignored when you create an OS policy assignment. + string name = 1; + + // OS policy assignment description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. List of OS policies to be applied to the VMs. + repeated OSPolicy os_policies = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Filter to select VMs. + InstanceFilter instance_filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rollout to deploy the OS policy assignment. + // A rollout is triggered in the following situations: + // 1) OSPolicyAssignment is created. + // 2) OSPolicyAssignment is updated and the update contains changes to one of + // the following fields: + // - instance_filter + // - os_policies + // 3) OSPolicyAssignment is deleted. + Rollout rollout = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The assignment revision ID + // A new revision is committed whenever a rollout is triggered for a OS policy + // assignment + string revision_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp revision_create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The etag for this OS policy assignment. + // If this is provided on update, it must match the server's etag. + string etag = 8; + + // Output only. OS policy assignment rollout state + RolloutState rollout_state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision has been successfully rolled out + // in this zone and new VMs will be assigned OS policies from this revision. + // + // For a given OS policy assignment, there is only one revision with a value + // of `true` for this field. + bool baseline = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision deletes the OS policy assignment. + bool deleted = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that reconciliation is in progress for the revision. + // This value is `true` when the `rollout_state` is one of: + // * IN_PROGRESS + // * CANCELLING + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated unique id for the OS policy assignment + // resource. + string uid = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OS policy assignment operation metadata provided by OS policy assignment API +// methods that return long running operations. +message OSPolicyAssignmentOperationMetadata { + // The OS policy assignment API method. + enum APIMethod { + // Invalid value + API_METHOD_UNSPECIFIED = 0; + + // Create OS policy assignment API method + CREATE = 1; + + // Update OS policy assignment API method + UPDATE = 2; + + // Delete OS policy assignment API method + DELETE = 3; + } + + // State of the rollout + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Reference to the `OSPolicyAssignment` API resource. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 1 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // The OS policy assignment API method. + APIMethod api_method = 2; + + // State of the rollout + RolloutState rollout_state = 3; + + // Rollout start time + google.protobuf.Timestamp rollout_start_time = 4; + + // Rollout update time + google.protobuf.Timestamp rollout_update_time = 5; +} + +// A request message to create an OS policy assignment +message CreateOSPolicyAssignmentRequest { + // Required. The parent resource name in the form: + // projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The OS policy assignment to be created. + OSPolicyAssignment os_policy_assignment = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The logical name of the OS policy assignment in the project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string os_policy_assignment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message to update an OS policy assignment +message UpdateOSPolicyAssignmentRequest { + // Required. The updated OS policy assignment. + OSPolicyAssignment os_policy_assignment = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the assignment should be + // updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message to get an OS policy assignment +message GetOSPolicyAssignmentRequest { + // Required. The resource name of OS policy assignment. + // + // Format: + // `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} + +// A request message to list OS policy assignments for a parent resource +message ListOSPolicyAssignmentsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of assignments to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignments` that indicates where this listing should continue + // from. + string page_token = 3; +} + +// A response message for listing all assignments under given parent. +message ListOSPolicyAssignmentsResponse { + // The list of assignments + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignments. + string next_page_token = 2; +} + +// A request message to list revisions for a OS policy assignment +message ListOSPolicyAssignmentRevisionsRequest { + // Required. The name of the OS policy assignment to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; + + // The maximum number of revisions to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignmentRevisions` that indicates where this listing should + // continue from. + string page_token = 3; +} + +// A response message for listing all revisions for a OS policy assignment. +message ListOSPolicyAssignmentRevisionsResponse { + // The OS policy assignment revisions + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // revisions. + string next_page_token = 2; +} + +// A request message for deleting a OS policy assignment. +message DeleteOSPolicyAssignmentRequest { + // Required. The name of the OS policy assignment to be deleted + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_common.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_common.proto new file mode 100644 index 00000000000..1a6491cdd07 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_common.proto @@ -0,0 +1,38 @@ +// Copyright 2024 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.osconfig.v1; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "Common"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Message encapsulating a value that can be either absolute ("fixed") or +// relative ("percent") to a value. +message FixedOrPercent { + // Type of the value. + oneof mode { + // Specifies a fixed value. + int32 fixed = 1; + + // Specifies the relative value defined as a percentage, which will be + // multiplied by a reference value. + int32 percent = 2; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_service.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_service.proto new file mode 100644 index 00000000000..e4a5f2c5a83 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -0,0 +1,158 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_deployments.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "OsConfigProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/zones/{zone}/instances/{instance}" + pattern: "projects/{project}/locations/{location}/instances/{instance}" +}; + +// OS Config API +// +// The OS Config service is a server-side component that you can use to +// manage package installations and patch jobs for virtual machine instances. +service OsConfigService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Patch VM instances by creating and running a patch job. + rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchJobs:execute" + body: "*" + }; + } + + // Get the patch job. This can be used to track the progress of an + // ongoing patch job or review the details of completed jobs. + rpc GetPatchJob(GetPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancel a patch job. The patch job must be active. Canceled patch jobs + // cannot be restarted. + rpc CancelPatchJob(CancelPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchJobs/*}:cancel" + body: "*" + }; + } + + // Get a list of patch jobs. + rpc ListPatchJobs(ListPatchJobsRequest) returns (ListPatchJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Get a list of instance details for a given patch job. + rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) + returns (ListPatchJobInstanceDetailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/patchJobs/*}/instanceDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // Create an OS Config patch deployment. + rpc CreatePatchDeployment(CreatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchDeployments" + body: "patch_deployment" + }; + option (google.api.method_signature) = + "parent,patch_deployment,patch_deployment_id"; + } + + // Get an OS Config patch deployment. + rpc GetPatchDeployment(GetPatchDeploymentRequest) returns (PatchDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get a page of OS Config patch deployments. + rpc ListPatchDeployments(ListPatchDeploymentsRequest) + returns (ListPatchDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete an OS Config patch deployment. + rpc DeletePatchDeployment(DeletePatchDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update an OS Config patch deployment. + rpc UpdatePatchDeployment(UpdatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + patch: "/v1/{patch_deployment.name=projects/*/patchDeployments/*}" + body: "patch_deployment" + }; + option (google.api.method_signature) = "patch_deployment,update_mask"; + } + + // Change state of patch deployment to "PAUSED". + // Patch deployment in paused state doesn't generate patch jobs. + rpc PausePatchDeployment(PausePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Change state of patch deployment back to "ACTIVE". + // Patch deployment in active state continues to generate patch jobs. + rpc ResumePatchDeployment(ResumePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto new file mode 100644 index 00000000000..8a868362f5e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -0,0 +1,202 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/cloud/osconfig/v1/os_policy_assignment_reports.proto"; +import "google/cloud/osconfig/v1/os_policy_assignments.proto"; +import "google/cloud/osconfig/v1/vulnerability.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsConfigZonalServiceProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Zonal OS Config API +// +// The OS Config service is the server-side component that allows users to +// manage package installations and patch jobs for Compute Engine VM instances. +service OsConfigZonalService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create an OS policy assignment. + // + // This method also creates the first revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = + "parent,os_policy_assignment,os_policy_assignment_id"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Update an existing OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc UpdateOSPolicyAssignment(UpdateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = "os_policy_assignment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Retrieve an existing OS policy assignment. + // + // This method always returns the latest revision. In order to retrieve a + // previous revision of the assignment, also provide the revision ID in the + // `name` parameter. + rpc GetOSPolicyAssignment(GetOSPolicyAssignmentRequest) + returns (OSPolicyAssignment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List the OS policy assignments under the parent resource. + // + // For each OS policy assignment, the latest revision is returned. + rpc ListOSPolicyAssignments(ListOSPolicyAssignmentsRequest) + returns (ListOSPolicyAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + }; + option (google.api.method_signature) = "parent"; + } + + // List the OS policy assignment revisions for a given OS policy assignment. + rpc ListOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest) + returns (ListOSPolicyAssignmentRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" + }; + option (google.api.method_signature) = "name"; + } + + // Delete the OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // If the LRO completes and is not cancelled, all revisions associated with + // the OS policy assignment are deleted. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Get the OS policy asssignment report for the specified Compute Engine VM + // instance. + rpc GetOSPolicyAssignmentReport(GetOSPolicyAssignmentReportRequest) + returns (OSPolicyAssignmentReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" + }; + option (google.api.method_signature) = "name"; + } + + // List OS policy asssignment reports for all Compute Engine VM instances in + // the specified zone. + rpc ListOSPolicyAssignmentReports(ListOSPolicyAssignmentReportsRequest) + returns (ListOSPolicyAssignmentReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" + }; + option (google.api.method_signature) = "parent"; + } + + // Get inventory data for the specified VM instance. If the VM has no + // associated inventory, the message `NOT_FOUND` is returned. + rpc GetInventory(GetInventoryRequest) returns (Inventory) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/inventory}" + }; + option (google.api.method_signature) = "name"; + } + + // List inventory data for all VM instances in the specified zone. + rpc ListInventories(ListInventoriesRequest) + returns (ListInventoriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the vulnerability report for the specified VM instance. Only VMs with + // inventory data have vulnerability reports associated with them. + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) + returns (VulnerabilityReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + }; + option (google.api.method_signature) = "name"; + } + + // List vulnerability reports for all VM instances in the specified zone. + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) + returns (ListVulnerabilityReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/patch_deployments.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/patch_deployments.proto new file mode 100644 index 00000000000..4df0e371048 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -0,0 +1,339 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/datetime.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "PatchDeployments"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Patch deployments are configurations that individual patch jobs use to +// complete a patch. These configurations include instance filter, package +// repository settings, and a schedule. For more information about creating and +// managing patch deployments, see [Scheduling patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/schedule-patch-jobs). +message PatchDeployment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchDeployment" + pattern: "projects/{project}/patchDeployments/{patch_deployment}" + }; + + // Represents state of patch peployment. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // Active value means that patch deployment generates Patch Jobs. + ACTIVE = 1; + + // Paused value means that patch deployment does not generate + // Patch jobs. Requires user action to move in and out from this state. + PAUSED = 2; + } + + // Unique name for the patch deployment resource in a project. The patch + // deployment name is in the form: + // `projects/{project_id}/patchDeployments/{patch_deployment_id}`. + // This field is ignored when you create a new patch deployment. + string name = 1; + + // Optional. Description of the patch deployment. Length of the description is + // limited to 1024 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. VM instances to patch. + PatchInstanceFilter instance_filter = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Patch configuration that is applied. + PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Duration of the patch. After the duration ends, the patch times + // out. + google.protobuf.Duration duration = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Schedule for the patch. + oneof schedule { + // Required. Schedule a one-time execution. + OneTimeSchedule one_time_schedule = 6 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule recurring executions. + RecurringSchedule recurring_schedule = 7 + [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. Time the patch deployment was created. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time the patch deployment was last updated. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time a patch job was started by this deployment. + // Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text + // format. + google.protobuf.Timestamp last_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Rollout strategy of the patch job. + PatchRollout rollout = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the patch deployment. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Sets the time for a one time patch deployment. Timestamp is in +// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. +message OneTimeSchedule { + // Required. The desired patch job execution time. + google.protobuf.Timestamp execute_time = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Sets the time for recurring patch deployments. +message RecurringSchedule { + // Specifies the frequency of the recurring patch deployments. + enum Frequency { + // Invalid. A frequency must be specified. + FREQUENCY_UNSPECIFIED = 0; + + // Indicates that the frequency of recurrence should be expressed in terms + // of weeks. + WEEKLY = 1; + + // Indicates that the frequency of recurrence should be expressed in terms + // of months. + MONTHLY = 2; + + // Indicates that the frequency of recurrence should be expressed in terms + // of days. + DAILY = 3; + } + + // Required. Defines the time zone that `time_of_day` is relative to. + // The rules for daylight saving time are determined by the chosen time zone. + google.type.TimeZone time_zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The time that the recurring schedule becomes effective. + // Defaults to `create_time` of the patch deployment. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end time at which a recurring patch deployment schedule is no + // longer active. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Time of the day to run a recurring deployment. + google.type.TimeOfDay time_of_day = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The frequency unit of this recurring schedule. + Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for this recurring schedule. + // Configurations must match frequency. + oneof schedule_config { + // Required. Schedule with weekly executions. + WeeklySchedule weekly = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule with monthly executions. + MonthlySchedule monthly = 7 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The time the last patch job ran successfully. + google.protobuf.Timestamp last_execute_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the next patch job is scheduled to run. + google.protobuf.Timestamp next_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a weekly schedule. +message WeeklySchedule { + // Required. Day of the week. + google.type.DayOfWeek day_of_week = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a monthly schedule. An example of a valid monthly schedule is +// "on the third Tuesday of the month" or "on the 15th of the month". +message MonthlySchedule { + // One day in a month. + oneof day_of_month { + // Required. Week day in a month. + WeekDayOfMonth week_day_of_month = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. One day of the month. 1-31 indicates the 1st to the 31st day. + // -1 indicates the last day of the month. Months without the target day + // will be skipped. For example, a schedule to run "every month on the 31st" + // will not run in February, April, June, etc. + int32 month_day = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Represents one week day in a month. An example is "the 4th Sunday". +message WeekDayOfMonth { + // Required. Week number in a month. 1-4 indicates the 1st to 4th week of the + // month. -1 indicates the last week of the month. + int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Represents the number of days before or after the given week day + // of month that the patch deployment is scheduled for. For example if + // `week_ordinal` and `day_of_week` values point to the second day of the + // month and this `day_offset` value is set to `3`, the patch deployment takes + // place three days after the second Tuesday of the month. If this value is + // negative, for example -5, the patches are deployed five days before before + // the second Tuesday of the month. Allowed values are in range [-30, 30]. + int32 day_offset = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for creating a patch deployment. +message CreatePatchDeploymentRequest { + // Required. The project to apply this patch deployment to in the form + // `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. A name for the patch deployment in the project. When creating a + // name the following rules apply: + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string patch_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The patch deployment to create. + PatchDeployment patch_deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for retrieving a patch deployment. +message GetPatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for listing patch deployments. +message ListPatchDeploymentsRequest { + // Required. The resource name of the parent in the form `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of patch deployments to return. Default is + // 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to + // ListPatchDeployments that indicates where this listing should continue + // from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for listing patch deployments. +message ListPatchDeploymentsResponse { + // The list of patch deployments. + repeated PatchDeployment patch_deployments = 1; + + // A pagination token that can be used to get the next page of patch + // deployments. + string next_page_token = 2; +} + +// A request message for deleting a patch deployment. +message DeletePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for updating a patch deployment. +message UpdatePatchDeploymentRequest { + // Required. The patch deployment to Update. + PatchDeployment patch_deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the patch deployment + // should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for pausing a patch deployment. +message PausePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for resuming a patch deployment. +message ResumePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/patch_jobs.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/patch_jobs.proto new file mode 100644 index 00000000000..ee3df87406f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/patch_jobs.proto @@ -0,0 +1,742 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "PatchJobs"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// A request message to initiate patching across Compute Engine +// instances. +message ExecutePatchJobRequest { + // Required. The project in which to run this patch in the form `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Required. Instances to patch, either explicitly or filtered by some + // criteria such as zone or labels. + PatchInstanceFilter instance_filter = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Patch configuration being applied. If omitted, instances are + // patched using the default configurations. + PatchConfig patch_config = 4; + + // Duration of the patch job. After the duration ends, the patch job + // times out. + google.protobuf.Duration duration = 5; + + // If this patch is a dry-run only, instances are contacted but + // will do nothing. + bool dry_run = 6; + + // Display name for this patch job. This does not have to be unique. + string display_name = 8; + + // Rollout strategy of the patch job. + PatchRollout rollout = 9; +} + +// Request to get an active or completed patch job. +message GetPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Request to list details for all instances that are part of a patch job. +message ListPatchJobInstanceDetailsRequest { + // Required. The parent for the instances are in the form of + // `projects/*/patchJobs/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; + + // The maximum number of instance details records to return. Default is 100. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // A filter expression that filters results listed in the response. This + // field supports filtering results by instance zone, name, state, or + // `failure_reason`. + string filter = 4; +} + +// A response message for listing the instances details for a patch job. +message ListPatchJobInstanceDetailsResponse { + // A list of instance status. + repeated PatchJobInstanceDetails patch_job_instance_details = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// Patch details for a VM instance. For more information about reviewing VM +// instance details, see +// [Listing all VM instance details for a specific patch +// job](https://cloud.google.com/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details). +message PatchJobInstanceDetails { + // The instance name in the form `projects/*/zones/*/instances/*` + string name = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + }]; + + // The unique identifier for the instance. This identifier is + // defined by the server. + string instance_system_id = 2; + + // Current state of instance patch. + Instance.PatchState state = 3; + + // If the patch fails, this field provides the reason. + string failure_reason = 4; + + // The number of times the agent that the agent attempts to apply the patch. + int64 attempt_count = 5; +} + +// A request message for listing patch jobs. +message ListPatchJobsRequest { + // Required. In the form of `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The maximum number of instance status to return. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by patch + // jobs to be included in the response. + // Currently, filtering is only available on the patch_deployment field. + string filter = 4; +} + +// A response message for listing patch jobs. +message ListPatchJobsResponse { + // The list of patch jobs. + repeated PatchJob patch_jobs = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// A high level representation of a patch job that is either in progress +// or has completed. +// +// Instance details are not included in the job. To paginate through instance +// details, use ListPatchJobInstanceDetails. +// +// For more information about patch jobs, see +// [Creating patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/create-patch-job). +message PatchJob { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchJob" + pattern: "projects/{project}/patchJobs/{patch_job}" + }; + + // Enumeration of the various states a patch job passes through as it + // executes. + enum State { + // State must be specified. + STATE_UNSPECIFIED = 0; + + // The patch job was successfully initiated. + STARTED = 1; + + // The patch job is looking up instances to run the patch on. + INSTANCE_LOOKUP = 2; + + // Instances are being patched. + PATCHING = 3; + + // Patch job completed successfully. + SUCCEEDED = 4; + + // Patch job completed but there were errors. + COMPLETED_WITH_ERRORS = 5; + + // The patch job was canceled. + CANCELED = 6; + + // The patch job timed out. + TIMED_OUT = 7; + } + + // A summary of the current patch state across all instances that this patch + // job affects. Contains counts of instances in different states. These states + // map to `InstancePatchState`. List patch job instance details to see the + // specific states of each instance. + message InstanceDetailsSummary { + // Number of instances pending patch job. + int64 pending_instance_count = 1; + + // Number of instances that are inactive. + int64 inactive_instance_count = 2; + + // Number of instances notified about patch job. + int64 notified_instance_count = 3; + + // Number of instances that have started. + int64 started_instance_count = 4; + + // Number of instances that are downloading patches. + int64 downloading_patches_instance_count = 5; + + // Number of instances that are applying patches. + int64 applying_patches_instance_count = 6; + + // Number of instances rebooting. + int64 rebooting_instance_count = 7; + + // Number of instances that have completed successfully. + int64 succeeded_instance_count = 8; + + // Number of instances that require reboot. + int64 succeeded_reboot_required_instance_count = 9; + + // Number of instances that failed. + int64 failed_instance_count = 10; + + // Number of instances that have acked and will start shortly. + int64 acked_instance_count = 11; + + // Number of instances that exceeded the time out while applying the patch. + int64 timed_out_instance_count = 12; + + // Number of instances that are running the pre-patch step. + int64 pre_patch_step_instance_count = 13; + + // Number of instances that are running the post-patch step. + int64 post_patch_step_instance_count = 14; + + // Number of instances that do not appear to be running the agent. Check to + // ensure that the agent is installed, running, and able to communicate with + // the service. + int64 no_agent_detected_instance_count = 15; + } + + // Unique identifier for this patch job in the form + // `projects/*/patchJobs/*` + string name = 1; + + // Display name for this patch job. This is not a unique identifier. + string display_name = 14; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Time this patch job was created. + google.protobuf.Timestamp create_time = 3; + + // Last time this patch job was updated. + google.protobuf.Timestamp update_time = 4; + + // The current state of the PatchJob. + State state = 5; + + // Instances to patch. + PatchInstanceFilter instance_filter = 13; + + // Patch configuration being applied. + PatchConfig patch_config = 7; + + // Duration of the patch job. After the duration ends, the + // patch job times out. + google.protobuf.Duration duration = 8; + + // Summary of instance details. + InstanceDetailsSummary instance_details_summary = 9; + + // If this patch job is a dry run, the agent reports that it has + // finished without running any updates on the VM instance. + bool dry_run = 10; + + // If this patch job failed, this message provides information about the + // failure. + string error_message = 11; + + // Reflects the overall progress of the patch job in the range of + // 0.0 being no progress to 100.0 being complete. + double percent_complete = 12; + + // Output only. Name of the patch deployment that created this patch job. + string patch_deployment = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; + + // Rollout strategy being applied. + PatchRollout rollout = 16; +} + +// Patch configuration specifications. Contains details on how to apply the +// patch(es) to a VM instance. +message PatchConfig { + // Post-patch reboot settings. + enum RebootConfig { + // The default behavior is DEFAULT. + REBOOT_CONFIG_UNSPECIFIED = 0; + + // The agent decides if a reboot is necessary by checking signals such as + // registry keys on Windows or `/var/run/reboot-required` on APT based + // systems. On RPM based systems, a set of core system package install times + // are compared with system boot time. + DEFAULT = 1; + + // Always reboot the machine after the update completes. + ALWAYS = 2; + + // Never reboot the machine after the update completes. + NEVER = 3; + } + + // Post-patch reboot settings. + RebootConfig reboot_config = 1; + + // Apt update settings. Use this setting to override the default `apt` patch + // rules. + AptSettings apt = 3; + + // Yum update settings. Use this setting to override the default `yum` patch + // rules. + YumSettings yum = 4; + + // Goo update settings. Use this setting to override the default `goo` patch + // rules. + GooSettings goo = 5; + + // Zypper update settings. Use this setting to override the default `zypper` + // patch rules. + ZypperSettings zypper = 6; + + // Windows update settings. Use this override the default windows patch rules. + WindowsUpdateSettings windows_update = 7; + + // The `ExecStep` to run before the patch update. + ExecStep pre_step = 8; + + // The `ExecStep` to run after the patch update. + ExecStep post_step = 9; + + // Allows the patch job to run on Managed instance groups (MIGs). + bool mig_instances_allowed = 10; +} + +// Namespace for instance state enums. +message Instance { + // Patch state of an instance. + enum PatchState { + // Unspecified. + PATCH_STATE_UNSPECIFIED = 0; + + // The instance is not yet notified. + PENDING = 1; + + // Instance is inactive and cannot be patched. + INACTIVE = 2; + + // The instance is notified that it should be patched. + NOTIFIED = 3; + + // The instance has started the patching process. + STARTED = 4; + + // The instance is downloading patches. + DOWNLOADING_PATCHES = 5; + + // The instance is applying patches. + APPLYING_PATCHES = 6; + + // The instance is rebooting. + REBOOTING = 7; + + // The instance has completed applying patches. + SUCCEEDED = 8; + + // The instance has completed applying patches but a reboot is required. + SUCCEEDED_REBOOT_REQUIRED = 9; + + // The instance has failed to apply the patch. + FAILED = 10; + + // The instance acked the notification and will start shortly. + ACKED = 11; + + // The instance exceeded the time out while applying the patch. + TIMED_OUT = 12; + + // The instance is running the pre-patch step. + RUNNING_PRE_PATCH_STEP = 13; + + // The instance is running the post-patch step. + RUNNING_POST_PATCH_STEP = 14; + + // The service could not detect the presence of the agent. Check to ensure + // that the agent is installed, running, and able to communicate with the + // service. + NO_AGENT_DETECTED = 15; + } +} + +// Message for canceling a patch job. +message CancelPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Apt patching is completed by executing `apt-get update && apt-get +// upgrade`. Additional options can be set to control how this is executed. +message AptSettings { + // Apt patch type. + enum Type { + // By default, upgrade will be performed. + TYPE_UNSPECIFIED = 0; + + // Runs `apt-get dist-upgrade`. + DIST = 1; + + // Runs `apt-get upgrade`. + UPGRADE = 2; + } + + // By changing the type to DIST, the patching is performed + // using `apt-get dist-upgrade` instead. + Type type = 1; + + // List of packages to exclude from update. These packages will be excluded + repeated string excludes = 2; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field cannot be specified with any other patch configuration + // fields. + repeated string exclusive_packages = 3; +} + +// Yum patching is performed by executing `yum update`. Additional options +// can be set to control how this is executed. +// +// Note that not all settings are supported on all platforms. +message YumSettings { + // Adds the `--security` flag to `yum update`. Not supported on + // all platforms. + bool security = 1; + + // Will cause patch to run `yum update-minimal` instead. + bool minimal = 2; + + // List of packages to exclude from update. These packages are excluded by + // using the yum `--exclude` flag. + repeated string excludes = 3; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field must not be specified with any other patch + // configuration fields. + repeated string exclusive_packages = 4; +} + +// Googet patching is performed by running `googet update`. +message GooSettings {} + +// Zypper patching is performed by running `zypper patch`. +// See also https://en.opensuse.org/SDB:Zypper_manual. +message ZypperSettings { + // Adds the `--with-optional` flag to `zypper patch`. + bool with_optional = 1; + + // Adds the `--with-update` flag, to `zypper patch`. + bool with_update = 2; + + // Install only patches with these categories. + // Common categories include security, recommended, and feature. + repeated string categories = 3; + + // Install only patches with these severities. + // Common severities include critical, important, moderate, and low. + repeated string severities = 4; + + // List of patches to exclude from update. + repeated string excludes = 5; + + // An exclusive list of patches to be updated. These are the only patches + // that will be installed using 'zypper patch patch:' command. + // This field must not be used with any other patch configuration fields. + repeated string exclusive_patches = 6; +} + +// Windows patching is performed using the Windows Update Agent. +message WindowsUpdateSettings { + // Microsoft Windows update classifications as defined in + // [1] + // https://support.microsoft.com/en-us/help/824684/description-of-the-standard-terminology-that-is-used-to-describe-micro + enum Classification { + // Invalid. If classifications are included, they must be specified. + CLASSIFICATION_UNSPECIFIED = 0; + + // "A widely released fix for a specific problem that addresses a critical, + // non-security-related bug." [1] + CRITICAL = 1; + + // "A widely released fix for a product-specific, security-related + // vulnerability. Security vulnerabilities are rated by their severity. The + // severity rating is indicated in the Microsoft security bulletin as + // critical, important, moderate, or low." [1] + SECURITY = 2; + + // "A widely released and frequent software update that contains additions + // to a product's definition database. Definition databases are often used + // to detect objects that have specific attributes, such as malicious code, + // phishing websites, or junk mail." [1] + DEFINITION = 3; + + // "Software that controls the input and output of a device." [1] + DRIVER = 4; + + // "New product functionality that is first distributed outside the context + // of a product release and that is typically included in the next full + // product release." [1] + FEATURE_PACK = 5; + + // "A tested, cumulative set of all hotfixes, security updates, critical + // updates, and updates. Additionally, service packs may contain additional + // fixes for problems that are found internally since the release of the + // product. Service packs my also contain a limited number of + // customer-requested design changes or features." [1] + SERVICE_PACK = 6; + + // "A utility or feature that helps complete a task or set of tasks." [1] + TOOL = 7; + + // "A tested, cumulative set of hotfixes, security updates, critical + // updates, and updates that are packaged together for easy deployment. A + // rollup generally targets a specific area, such as security, or a + // component of a product, such as Internet Information Services (IIS)." [1] + UPDATE_ROLLUP = 8; + + // "A widely released fix for a specific problem. An update addresses a + // noncritical, non-security-related bug." [1] + UPDATE = 9; + } + + // Only apply updates of these windows update classifications. If empty, all + // updates are applied. + repeated Classification classifications = 1; + + // List of KBs to exclude from update. + repeated string excludes = 2; + + // An exclusive list of kbs to be updated. These are the only patches + // that will be updated. This field must not be used with other + // patch configurations. + repeated string exclusive_patches = 3; +} + +// A step that runs an executable for a PatchJob. +message ExecStep { + // The ExecStepConfig for all Linux VMs targeted by the PatchJob. + ExecStepConfig linux_exec_step_config = 1; + + // The ExecStepConfig for all Windows VMs targeted by the PatchJob. + ExecStepConfig windows_exec_step_config = 2; +} + +// Common configurations for an ExecStep. +message ExecStepConfig { + // The interpreter used to execute the a file. + enum Interpreter { + // Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the + // interpreter will be parsed from the shebang line of the script if + // unspecified. + INTERPRETER_UNSPECIFIED = 0; + + // Indicates that the script is run with `/bin/sh` on Linux and `cmd` + // on Windows. + SHELL = 1; + + // Indicates that the file is run with PowerShell flags + // `-NonInteractive`, `-NoProfile`, and `-ExecutionPolicy Bypass`. + POWERSHELL = 2; + } + + // Location of the executable. + oneof executable { + // An absolute path to the executable on the VM. + string local_path = 1; + + // A Cloud Storage object containing the executable. + GcsObject gcs_object = 2; + } + + // Defaults to [0]. A list of possible return values that the + // execution can return to indicate a success. + repeated int32 allowed_success_codes = 3; + + // The script interpreter to use to run the script. If no interpreter is + // specified the script will be executed directly, which will likely + // only succeed for scripts with [shebang lines] + // (https://en.wikipedia.org/wiki/Shebang_\(Unix\)). + Interpreter interpreter = 4; +} + +// Cloud Storage object representation. +message GcsObject { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Generation number of the Cloud Storage object. This is used to + // ensure that the ExecStep specified by this PatchJob does not change. + int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A filter to target VM instances for patching. The targeted +// VMs must meet all criteria specified. So if both labels and zones are +// specified, the patch job targets only VMs with those labels and in those +// zones. +message PatchInstanceFilter { + // Targets a group of VM instances by using their [assigned + // labels](https://cloud.google.com/compute/docs/labeling-resources). Labels + // are key-value pairs. A `GroupLabel` is a combination of labels + // that is used to target VMs for a patch job. + // + // For example, a patch job can target VMs that have the following + // `GroupLabel`: `{"env":"test", "app":"web"}`. This means that the patch job + // is applied to VMs that have both the labels `env=test` and `app=web`. + message GroupLabel { + // Compute Engine instance labels that must be present for a VM + // instance to be targeted by this filter. + map labels = 1; + } + + // Target all VM instances in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // Targets VM instances matching ANY of these GroupLabels. This allows + // targeting of disparate groups of VM instances. + repeated GroupLabel group_labels = 2; + + // Targets VM instances in ANY of these zones. Leave empty to target VM + // instances in any zone. + repeated string zones = 3; + + // Targets any of the VM instances specified. Instances are specified by their + // URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`, + // `projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or + // `https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]` + repeated string instances = 4; + + // Targets VMs whose name starts with one of these prefixes. Similar to + // labels, this is another way to group VMs when targeting configs, for + // example prefix="prod-". + repeated string instance_name_prefixes = 5; +} + +// Patch rollout configuration specifications. Contains details on the +// concurrency control when applying patch(es) to all targeted VMs. +message PatchRollout { + // Type of the rollout. + enum Mode { + // Mode must be specified. + MODE_UNSPECIFIED = 0; + + // Patches are applied one zone at a time. The patch job begins in the + // region with the lowest number of targeted VMs. Within the region, + // patching begins in the zone with the lowest number of targeted VMs. If + // multiple regions (or zones within a region) have the same number of + // targeted VMs, a tie-breaker is achieved by sorting the regions or zones + // in alphabetical order. + ZONE_BY_ZONE = 1; + + // Patches are applied to VMs in all zones at the same time. + CONCURRENT_ZONES = 2; + } + + // Mode of the patch rollout. + Mode mode = 1; + + // The maximum number (or percentage) of VMs per zone to disrupt at any given + // moment. The number of VMs calculated from multiplying the percentage by the + // total number of VMs in a zone is rounded up. + // + // During patching, a VM is considered disrupted from the time the agent is + // notified to begin until patching has completed. This disruption time + // includes the time to complete reboot and any post-patch steps. + // + // A VM contributes to the disruption budget if its patching operation fails + // either when applying the patches, running pre or post patch steps, or if it + // fails to respond with a success notification before timing out. VMs that + // are not running or do not have an active agent do not count toward this + // disruption budget. + // + // For zone-by-zone rollouts, if the disruption budget in a zone is exceeded, + // the patch job stops, because continuing to the next zone requires + // completion of the patch process in the previous zone. + // + // For example, if the disruption budget has a fixed value of `10`, and 8 VMs + // fail to patch in the current zone, the patch job continues to patch 2 VMs + // at a time until the zone is completed. When that zone is completed + // successfully, patching begins with 10 VMs at a time in the next zone. If 10 + // VMs in the next zone fail to patch, the patch job stops. + FixedOrPercent disruption_budget = 2; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/vulnerability.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/vulnerability.proto new file mode 100644 index 00000000000..f586776da5f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/cloud/osconfig/v1/vulnerability.proto @@ -0,0 +1,365 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// This API resource represents the vulnerability report for a specified +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// For more information, see [Vulnerability +// reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). +message VulnerabilityReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }; + + // A vulnerability affecting the VM instance. + message Vulnerability { + // Contains metadata information for the vulnerability. This information is + // collected from the upstream feed of the operating system. + message Details { + // A reference for this vulnerability. + message Reference { + // The url of the reference. + string url = 1; + + // The source of the reference e.g. NVD. + string source = 2; + } + + // The CVE of the vulnerability. CVE cannot be + // empty and the combination of should be unique + // across vulnerabilities for a VM. + string cve = 1; + + // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of + // 0 - 10 where 0 indicates low severity and 10 indicates high severity. + float cvss_v2_score = 2; + + // The full description of the CVSSv3 for this vulnerability from NVD. + CVSSv3 cvss_v3 = 3; + + // Assigned severity/impact ranking from the distro. + string severity = 4; + + // The note or description describing the vulnerability from the distro. + string description = 5; + + // Corresponds to the references attached to the `VulnerabilityDetails`. + repeated Reference references = 6; + } + + // OS inventory item that is affected by a vulnerability or fixed as a + // result of a vulnerability. + message Item { + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some + // operating systems, this field might be empty. + string installed_inventory_item_id = 1; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + string available_inventory_item_id = 2; + + // The recommended [CPE URI](https://cpe.mitre.org/specification/) update + // that contains a fix for this vulnerability. + string fixed_cpe_uri = 3; + + // The upstream OS patch, packages or KB that fixes the vulnerability. + string upstream_fix = 4; + } + + // Contains metadata as per the upstream feed of the operating system and + // NVD. + Details details = 1; + + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some distros, + // this field may be empty. + repeated string installed_inventory_item_ids = 2 [deprecated = true]; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + repeated string available_inventory_item_ids = 3 [deprecated = true]; + + // The timestamp for when the vulnerability was first detected. + google.protobuf.Timestamp create_time = 4; + + // The timestamp for when the vulnerability was last modified. + google.protobuf.Timestamp update_time = 5; + + // List of items affected by the vulnerability. + repeated Item items = 6; + } + + // Output only. The `vulnerabilityReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of vulnerabilities affecting the VM. + repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp for when the last vulnerability report was generated for the + // VM. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting the vulnerability report for the specified VM. +message GetVulnerabilityReportRequest { + // Required. API resource name for vulnerability resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + } + ]; +} + +// A request message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListVulnerabilityReports` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `vulnerabilityReport` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsResponse { + // List of vulnerabilityReport objects. + repeated VulnerabilityReport vulnerability_reports = 1; + + // The pagination token to retrieve the next page of vulnerabilityReports + // object. + string next_page_token = 2; +} + +// Common Vulnerability Scoring System version 3. +// For details, see https://www.first.org/cvss/specification-document +message CVSSv3 { + // This metric reflects the context by which vulnerability exploitation is + // possible. + enum AttackVector { + // Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The vulnerable component is bound to the network stack and the set of + // possible attackers extends beyond the other options listed below, up to + // and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1; + + // The vulnerable component is bound to the network stack, but the attack is + // limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2; + + // The vulnerable component is not bound to the network stack and the + // attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3; + + // The attack requires the attacker to physically touch or manipulate the + // vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4; + } + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + enum AttackComplexity { + // Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0; + + // Specialized access conditions or extenuating circumstances do not exist. + // An attacker can expect repeatable success when attacking the vulnerable + // component. + ATTACK_COMPLEXITY_LOW = 1; + + // A successful attack depends on conditions beyond the attacker's control. + // That is, a successful attack cannot be accomplished at will, but requires + // the attacker to invest in some measurable amount of effort in preparation + // or execution against the vulnerable component before a successful attack + // can be expected. + ATTACK_COMPLEXITY_HIGH = 2; + } + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + enum PrivilegesRequired { + // Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + + // The attacker is unauthorized prior to attack, and therefore does not + // require any access to settings or files of the vulnerable system to + // carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1; + + // The attacker requires privileges that provide basic user capabilities + // that could normally affect only settings and files owned by a user. + // Alternatively, an attacker with Low privileges has the ability to access + // only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2; + + // The attacker requires privileges that provide significant (e.g., + // administrative) control over the vulnerable component allowing access to + // component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3; + } + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + enum UserInteraction { + // Invalid value. + USER_INTERACTION_UNSPECIFIED = 0; + + // The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1; + + // Successful exploitation of this vulnerability requires a user to take + // some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2; + } + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + enum Scope { + // Invalid value. + SCOPE_UNSPECIFIED = 0; + + // An exploited vulnerability can only affect resources managed by the same + // security authority. + SCOPE_UNCHANGED = 1; + + // An exploited vulnerability can affect resources beyond the security scope + // managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2; + } + + // The Impact metrics capture the effects of a successfully exploited + // vulnerability on the component that suffers the worst outcome that is most + // directly and predictably associated with the attack. + enum Impact { + // Invalid value. + IMPACT_UNSPECIFIED = 0; + + // High impact. + IMPACT_HIGH = 1; + + // Low impact. + IMPACT_LOW = 2; + + // No impact. + IMPACT_NONE = 3; + } + + // The base score is a function of the base metric scores. + // https://www.first.org/cvss/specification-document#Base-Metrics + float base_score = 1; + + // The Exploitability sub-score equation is derived from the Base + // Exploitability metrics. + // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics + float exploitability_score = 2; + + // The Impact sub-score equation is derived from the Base Impact metrics. + float impact_score = 3; + + // This metric reflects the context by which vulnerability exploitation is + // possible. + AttackVector attack_vector = 5; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 6; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 7; + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + UserInteraction user_interaction = 8; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 9; + + // This metric measures the impact to the confidentiality of the information + // resources managed by a software component due to a successfully exploited + // vulnerability. + Impact confidentiality_impact = 10; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 11; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 12; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto new file mode 100644 index 00000000000..c442283b3ca --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto @@ -0,0 +1,83 @@ +// Copyright 2024 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.identity.accesscontextmanager.type; + +option csharp_namespace = "Google.Identity.AccessContextManager.Type"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type"; +option java_package = "com.google.identity.accesscontextmanager.type"; +option java_multiple_files = true; +option java_outer_classname = "TypeProto"; +option php_namespace = "Google\\Identity\\AccessContextManager\\Type"; +option ruby_package = "Google::Identity::AccessContextManager::Type"; + +// The encryption state of the device. +enum DeviceEncryptionStatus { + // The encryption status of the device is not specified or not known. + ENCRYPTION_UNSPECIFIED = 0; + + // The device does not support encryption. + ENCRYPTION_UNSUPPORTED = 1; + + // The device supports encryption, but is currently unencrypted. + UNENCRYPTED = 2; + + // The device is encrypted. + ENCRYPTED = 3; +} + +// The operating system type of the device. +// Next id: 7 +enum OsType { + // The operating system of the device is not specified or not known. + OS_UNSPECIFIED = 0; + + // A desktop Mac operating system. + DESKTOP_MAC = 1; + + // A desktop Windows operating system. + DESKTOP_WINDOWS = 2; + + // A desktop Linux operating system. + DESKTOP_LINUX = 3; + + // A desktop ChromeOS operating system. + DESKTOP_CHROME_OS = 6; + + // An Android operating system. + ANDROID = 4; + + // An iOS operating system. + IOS = 5; +} + +// The degree to which the device is managed by the Cloud organization. +enum DeviceManagementLevel { + // The device's management level is not specified or not known. + MANAGEMENT_UNSPECIFIED = 0; + + // The device is not managed. + NONE = 1; + + // Basic management is enabled, which is generally limited to monitoring and + // wiping the corporate account. + BASIC = 2; + + // Complete device management. This includes more thorough monitoring and the + // ability to directly manage the device (such as remote wiping). This can be + // enabled through the Android Enterprise Platform. + COMPLETE = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto new file mode 100644 index 00000000000..7563f09a025 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto @@ -0,0 +1,986 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessContextManagerProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// API for setting [access levels] +// [google.identity.accesscontextmanager.v1.AccessLevel] and [service +// perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] +// for Google Cloud projects. Each organization has one [access policy] +// [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the +// [access levels] [google.identity.accesscontextmanager.v1.AccessLevel] +// and [service perimeters] +// [google.identity.accesscontextmanager.v1.ServicePerimeter]. This +// [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is +// applicable to all resources in the organization. +// AccessPolicies +service AccessContextManager { + option (google.api.default_host) = "accesscontextmanager.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all [access policies] + // [google.identity.accesscontextmanager.v1.AccessPolicy] in an + // organization. + rpc ListAccessPolicies(ListAccessPoliciesRequest) returns (ListAccessPoliciesResponse) { + option (google.api.http) = { + get: "/v1/accessPolicies" + }; + } + + // Returns an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] based on the name. + rpc GetAccessPolicy(GetAccessPolicyRequest) returns (AccessPolicy) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an access policy. This method fails if the organization already has + // an access policy. The long-running operation has a successful status + // after the access policy propagates to long-lasting storage. + // Syntactic and basic semantic errors are returned in `metadata` as a + // BadRequest proto. + rpc CreateAccessPolicy(AccessPolicy) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/accessPolicies" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "AccessPolicy" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. The + // long-running operation from this RPC has a successful status after the + // changes to the [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] propagate + // to long-lasting storage. + rpc UpdateAccessPolicy(UpdateAccessPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{policy.name=accessPolicies/*}" + body: "policy" + }; + option (google.api.method_signature) = "policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AccessPolicy" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] based on the + // resource name. The long-running operation has a successful status after the + // [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] + // is removed from long-lasting storage. + rpc DeleteAccessPolicy(DeleteAccessPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] for an access + // policy. + rpc ListAccessLevels(ListAccessLevelsRequest) returns (ListAccessLevelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accessPolicies/*}/accessLevels" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + // name. + rpc GetAccessLevel(GetAccessLevelRequest) returns (AccessLevel) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*/accessLevels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + // operation from this RPC has a successful status after the [access + // level] [google.identity.accesscontextmanager.v1.AccessLevel] + // propagates to long-lasting storage. If [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contain + // errors, an error response is returned for the first error encountered. + rpc CreateAccessLevel(CreateAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/accessLevels" + body: "access_level" + }; + option (google.api.method_signature) = "parent,access_level"; + option (google.longrunning.operation_info) = { + response_type: "AccessLevel" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + // operation from this RPC has a successful status after the changes to + // the [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] propagate + // to long-lasting storage. If [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contain + // errors, an error response is returned for the first error encountered. + rpc UpdateAccessLevel(UpdateAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{access_level.name=accessPolicies/*/accessLevels/*}" + body: "access_level" + }; + option (google.api.method_signature) = "access_level,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AccessLevel" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + // name. The long-running operation from this RPC has a successful status + // after the [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] has been removed + // from long-lasting storage. + rpc DeleteAccessLevel(DeleteAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*/accessLevels/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Replaces all existing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] in an [access + // policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with + // the [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] provided. This + // is done atomically. The long-running operation from this RPC has a + // successful status after all replacements propagate to long-lasting + // storage. If the replacement contains errors, an error response is returned + // for the first error encountered. Upon error, the replacement is cancelled, + // and existing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] are not + // affected. The Operation.response field contains + // ReplaceAccessLevelsResponse. Removing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contained in existing + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] result in an + // error. + rpc ReplaceAccessLevels(ReplaceAccessLevelsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/accessLevels:replaceAll" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ReplaceAccessLevelsResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] for an + // access policy. + rpc ListServicePerimeters(ListServicePerimetersRequest) returns (ListServicePerimetersResponse) { + option (google.api.http) = { + get: "/v1/{parent=accessPolicies/*}/servicePerimeters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + // resource name. + rpc GetServicePerimeter(GetServicePerimeterRequest) returns (ServicePerimeter) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*/servicePerimeters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. The + // long-running operation from this RPC has a successful status after the + // [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] + // propagates to long-lasting storage. If a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + // errors, an error response is returned for the first error encountered. + rpc CreateServicePerimeter(CreateServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters" + body: "service_perimeter" + }; + option (google.api.method_signature) = "parent,service_perimeter"; + option (google.longrunning.operation_info) = { + response_type: "ServicePerimeter" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. The + // long-running operation from this RPC has a successful status after the + // [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] + // propagates to long-lasting storage. If a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + // errors, an error response is returned for the first error encountered. + rpc UpdateServicePerimeter(UpdateServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{service_perimeter.name=accessPolicies/*/servicePerimeters/*}" + body: "service_perimeter" + }; + option (google.api.method_signature) = "service_perimeter,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ServicePerimeter" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + // resource name. The long-running operation from this RPC has a successful + // status after the [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] is removed from + // long-lasting storage. + rpc DeleteServicePerimeter(DeleteServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*/servicePerimeters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Replace all existing [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in an [access + // policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with the + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. This + // is done atomically. The long-running operation from this RPC has a + // successful status after all replacements propagate to long-lasting storage. + // Replacements containing errors result in an error response for the first + // error encountered. Upon an error, replacement are cancelled and existing + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] are not + // affected. The Operation.response field contains + // ReplaceServicePerimetersResponse. + rpc ReplaceServicePerimeters(ReplaceServicePerimetersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters:replaceAll" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ReplaceServicePerimetersResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Commits the dry-run specification for all the [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in an + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + // A commit operation on a service perimeter involves copying its `spec` field + // to the `status` field of the service perimeter. Only [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] with + // `use_explicit_dry_run_spec` field set to true are affected by a commit + // operation. The long-running operation from this RPC has a successful + // status after the dry-run specifications for all the [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] have been + // committed. If a commit fails, it causes the long-running operation to + // return an error response and the entire commit operation is cancelled. + // When successful, the Operation.response field contains + // CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are + // cleared after a successful commit operation. + rpc CommitServicePerimeters(CommitServicePerimetersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters:commit" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "CommitServicePerimetersResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [GcpUserAccessBindings] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] for a + // Google Cloud organization. + rpc ListGcpUserAccessBindings(ListGcpUserAccessBindingsRequest) returns (ListGcpUserAccessBindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/gcpUserAccessBindings" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] with + // the given name. + rpc GetGcpUserAccessBinding(GetGcpUserAccessBindingRequest) returns (GcpUserAccessBinding) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/gcpUserAccessBindings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. If the + // client specifies a [name] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.name], + // the server ignores it. Fails if a resource already exists with the same + // [group_key] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.group_key]. + // Completion of this long-running operation does not necessarily signify that + // the new binding is deployed onto all affected users, which may take more + // time. + rpc CreateGcpUserAccessBinding(CreateGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/gcpUserAccessBindings" + body: "gcp_user_access_binding" + }; + option (google.api.method_signature) = "parent,gcp_user_access_binding"; + option (google.longrunning.operation_info) = { + response_type: "GcpUserAccessBinding" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Updates a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. + // Completion of this long-running operation does not necessarily signify that + // the changed binding is deployed onto all affected users, which may take + // more time. + rpc UpdateGcpUserAccessBinding(UpdateGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{gcp_user_access_binding.name=organizations/*/gcpUserAccessBindings/*}" + body: "gcp_user_access_binding" + }; + option (google.api.method_signature) = "gcp_user_access_binding,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GcpUserAccessBinding" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Deletes a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. + // Completion of this long-running operation does not necessarily signify that + // the binding deletion is deployed onto all affected users, which may take + // more time. + rpc DeleteGcpUserAccessBinding(DeleteGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/gcpUserAccessBindings/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Sets the IAM policy for the specified Access Context Manager + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + // This method replaces the existing IAM policy on the access policy. The IAM + // policy controls the set of users who can perform specific operations on the + // Access Context Manager [access + // policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:setIamPolicy" + body: "*" + }; + } + + // Gets the IAM policy for the specified Access Context Manager + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:getIamPolicy" + body: "*" + }; + } + + // Returns the IAM permissions that the caller has on the specified Access + // Context Manager resource. The resource can be an + // [AccessPolicy][google.identity.accesscontextmanager.v1.AccessPolicy], + // [AccessLevel][google.identity.accesscontextmanager.v1.AccessLevel], or + // [ServicePerimeter][google.identity.accesscontextmanager.v1.ServicePerimeter + // ]. This method does not support other resources. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=accessPolicies/*/accessLevels/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1/{resource=accessPolicies/*/servicePerimeters/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// A request to list all `AccessPolicies` for a container. +message ListAccessPoliciesRequest { + // Required. Resource name for the container to list AccessPolicy instances + // from. + // + // Format: + // `organizations/{org_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Number of AccessPolicy instances to include in the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of AccessPolicy instances. Defaults to + // the first page of results. + string page_token = 3; +} + +// A response to `ListAccessPoliciesRequest`. +message ListAccessPoliciesResponse { + // List of the AccessPolicy instances. + repeated AccessPolicy access_policies = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `AccessPolicy`. +message GetAccessPolicyRequest { + // Required. Resource name for the access policy to get. + // + // Format `accessPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + } + ]; +} + +// A request to update an `AccessPolicy`. +message UpdateAccessPolicyRequest { + // Required. The updated AccessPolicy. + AccessPolicy policy = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an `AccessPolicy`. +message DeleteAccessPolicyRequest { + // Required. Resource name for the access policy to delete. + // + // Format `accessPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + } + ]; +} + +// A request to list all `AccessLevels` in an `AccessPolicy`. +message ListAccessLevelsRequest { + // Required. Resource name for the access policy to list [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] from. + // + // Format: + // `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Number of [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] to include in + // the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + // Defaults to the first page of results. + string page_token = 3; + + // Whether to return `BasicLevels` in the Cloud Common Expression language, as + // `CustomLevels`, rather than as `BasicLevels`. Defaults to returning + // `AccessLevels` in the format they were defined. + LevelFormat access_level_format = 4; +} + +// A response to `ListAccessLevelsRequest`. +message ListAccessLevelsResponse { + // List of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + repeated AccessLevel access_levels = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `AccessLevel`. +message GetAccessLevelRequest { + // Required. Resource name for the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: + // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Whether to return `BasicLevels` in the Cloud Common Expression + // Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where + // [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel] + // are returned as `BasicLevels` or `CustomLevels` based on how they were + // created. If set to CEL, all [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] are returned as + // `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent + // `CustomLevels`. + LevelFormat access_level_format = 2; +} + +// A request to create an `AccessLevel`. +message CreateAccessLevelRequest { + // Required. Resource name for the access policy which owns this [Access + // Level] [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Required. The [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] to create. + // Syntactic correctness of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] is a + // precondition for creation. + AccessLevel access_level = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update an `AccessLevel`. +message UpdateAccessLevelRequest { + // Required. The updated [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. Syntactic + // correctness of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] is a + // precondition for creation. + AccessLevel access_level = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an `AccessLevel`. +message DeleteAccessLevelRequest { + // Required. Resource name for the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: + // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; +} + +// A request to replace all existing Access Levels in an Access Policy with +// the Access Levels provided. This is done atomically. +message ReplaceAccessLevelsRequest { + // Required. Resource name for the access policy which owns these + // [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Required. The desired [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] that should + // replace all existing [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] in the + // [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated AccessLevel access_levels = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // replace operation is to be performed on. If, at the time of replace, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the replace operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 4; +} + +// A response to ReplaceAccessLevelsRequest. This will be put inside of +// Operation.response field. +message ReplaceAccessLevelsResponse { + // List of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + repeated AccessLevel access_levels = 1; +} + +// A request to list all `ServicePerimeters` in an `AccessPolicy`. +message ListServicePerimetersRequest { + // Required. Resource name for the access policy to list [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] from. + // + // Format: + // `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Number of [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to include + // in the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + // Defaults to the first page of results. + string page_token = 3; +} + +// A response to `ListServicePerimetersRequest`. +message ListServicePerimetersResponse { + // List of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + repeated ServicePerimeter service_perimeters = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `ServicePerimeter`. +message GetServicePerimeterRequest { + // Required. Resource name for the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: + // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; +} + +// A request to create a `ServicePerimeter`. +message CreateServicePerimeterRequest { + // Required. Resource name for the access policy which owns this [Service + // Perimeter] [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Required. The [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to create. + // Syntactic correctness of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] is a + // precondition for creation. + ServicePerimeter service_perimeter = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update a `ServicePerimeter`. +message UpdateServicePerimeterRequest { + // Required. The updated `ServicePerimeter`. Syntactic correctness of the + // `ServicePerimeter` is a precondition for creation. + ServicePerimeter service_perimeter = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete a `ServicePerimeter`. +message DeleteServicePerimeterRequest { + // Required. Resource name for the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: + // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; +} + +// A request to replace all existing Service Perimeters in an Access Policy +// with the Service Perimeters provided. This is done atomically. +message ReplaceServicePerimetersRequest { + // Required. Resource name for the access policy which owns these + // [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Required. The desired [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] that should + // replace all existing [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in the + // [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated ServicePerimeter service_perimeters = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // replace operation is to be performed on. If, at the time of replace, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the replace operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 3; +} + +// A response to ReplaceServicePerimetersRequest. This will be put inside of +// Operation.response field. +message ReplaceServicePerimetersResponse { + // List of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + repeated ServicePerimeter service_perimeters = 1; +} + +// A request to commit dry-run specs in all [Service Perimeters] +// [google.identity.accesscontextmanager.v1.ServicePerimeter] belonging to +// an [Access Policy][google.identity.accesscontextmanager.v1.AccessPolicy]. +message CommitServicePerimetersRequest { + // Required. Resource name for the parent [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] which owns all + // [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in scope for + // the commit operation. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // commit operation is to be performed on. If, at the time of commit, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the commit operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 2; +} + +// A response to CommitServicePerimetersRequest. This will be put inside of +// Operation.response field. +message CommitServicePerimetersResponse { + // List of all the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances in + // the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated ServicePerimeter service_perimeters = 1; +} + +// The format used in an `AccessLevel`. +enum LevelFormat { + // The format was not specified. + LEVEL_FORMAT_UNSPECIFIED = 0; + + // Uses the format the resource was defined in. BasicLevels are returned as + // BasicLevels, CustomLevels are returned as CustomLevels. + AS_DEFINED = 1; + + // Use Cloud Common Expression Language when returning the resource. Both + // BasicLevels and CustomLevels are returned as CustomLevels. + CEL = 2; +} + +// Request of [ListGcpUserAccessBindings] +// [google.identity.accesscontextmanager.v1.AccessContextManager.ListGcpUserAccessBindings]. +message ListGcpUserAccessBindingsRequest { + // Required. Example: "organizations/256" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Optional. Maximum number of items to return. The server may return fewer items. + // If left blank, the server may return any number of items. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If left blank, returns the first page. To enumerate all items, use the + // [next_page_token] + // [google.identity.accesscontextmanager.v1.ListGcpUserAccessBindingsResponse.next_page_token] + // from your previous list operation. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of [ListGcpUserAccessBindings] +// [google.identity.accesscontextmanager.v1.AccessContextManager.ListGcpUserAccessBindings]. +message ListGcpUserAccessBindingsResponse { + // [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + repeated GcpUserAccessBinding gcp_user_access_bindings = 1; + + // Token to get the next page of items. If blank, there are no more items. + string next_page_token = 2; +} + +// Request of [GetGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.GetGcpUserAccessBinding]. +message GetGcpUserAccessBindingRequest { + // Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + } + ]; +} + +// Request of [CreateGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.CreateGcpUserAccessBinding]. +message CreateGcpUserAccessBindingRequest { + // Required. Example: "organizations/256" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + GcpUserAccessBinding gcp_user_access_binding = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request of [UpdateGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.UpdateGcpUserAccessBinding]. +message UpdateGcpUserAccessBindingRequest { + // Required. [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + GcpUserAccessBinding gcp_user_access_binding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only the fields specified in this mask are updated. Because name and + // group_key cannot be changed, update_mask is required and must always be: + // + // update_mask { + // paths: "access_levels" + // } + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request of [DeleteGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.DeleteGcpUserAccessBinding]. +message DeleteGcpUserAccessBindingRequest { + // Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + } + ]; +} + +// Currently, a completed operation means nothing. In the future, this metadata +// and a completed operation may indicate that the binding has taken effect and +// is affecting access decisions for all users. +message GcpUserAccessBindingOperationMetadata { + +} + +// Metadata of Access Context Manager's Long Running Operations. +message AccessContextManagerOperationMetadata { + +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto new file mode 100644 index 00000000000..204b74a8290 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto @@ -0,0 +1,192 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/identity/accesscontextmanager/type/device_resources.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessLevelProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// An `AccessLevel` is a label that can be applied to requests to Google Cloud +// services, along with a list of requirements necessary for the label to be +// applied. +message AccessLevel { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + pattern: "accessPolicies/{access_policy}/accessLevels/{access_level}" + }; + + // Required. Resource name for the Access Level. The `short_name` component + // must begin with a letter and only include alphanumeric and '_'. Format: + // `accessPolicies/{access_policy}/accessLevels/{access_level}`. The maximum + // length of the `access_level` component is 50 characters. + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `AccessLevel` and its use. Does not affect behavior. + string description = 3; + + // Required. Describes the necessary conditions for the level to apply. + oneof level { + // A `BasicLevel` composed of `Conditions`. + BasicLevel basic = 4; + + // A `CustomLevel` written in the Common Expression Language. + CustomLevel custom = 5; + } + + // Output only. Time the `AccessLevel` was created in UTC. + google.protobuf.Timestamp create_time = 6; + + // Output only. Time the `AccessLevel` was updated in UTC. + google.protobuf.Timestamp update_time = 7; +} + +// `BasicLevel` is an `AccessLevel` using a set of recommended features. +message BasicLevel { + // Options for how the `conditions` list should be combined to determine if + // this `AccessLevel` is applied. Default is AND. + enum ConditionCombiningFunction { + // All `Conditions` must be true for the `BasicLevel` to be true. + AND = 0; + + // If at least one `Condition` is true, then the `BasicLevel` is true. + OR = 1; + } + + // Required. A list of requirements for the `AccessLevel` to be granted. + repeated Condition conditions = 1; + + // How the `conditions` list should be combined to determine if a request is + // granted this `AccessLevel`. If AND is used, each `Condition` in + // `conditions` must be satisfied for the `AccessLevel` to be applied. If OR + // is used, at least one `Condition` in `conditions` must be satisfied for the + // `AccessLevel` to be applied. Default behavior is AND. + ConditionCombiningFunction combining_function = 2; +} + +// A condition necessary for an `AccessLevel` to be granted. The Condition is an +// AND over its fields. So a Condition is true if: 1) the request IP is from one +// of the listed subnetworks AND 2) the originating device complies with the +// listed device policy AND 3) all listed access levels are granted AND 4) the +// request was sent at a time allowed by the DateTimeRestriction. +message Condition { + // CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for + // a CIDR IP address block, the specified IP address portion must be properly + // truncated (i.e. all the host bits must be zero) or the input is considered + // malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is + // not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas + // "2001:db8::1/32" is not. The originating IP of a request must be in one of + // the listed subnets in order for this Condition to be true. If empty, all IP + // addresses are allowed. + repeated string ip_subnetworks = 1; + + // Device specific restrictions, all restrictions must hold for the + // Condition to be true. If not specified, all devices are allowed. + DevicePolicy device_policy = 2; + + // A list of other access levels defined in the same `Policy`, referenced by + // resource name. Referencing an `AccessLevel` which does not exist is an + // error. All access levels listed must be granted for the Condition + // to be true. Example: + // "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` + repeated string required_access_levels = 3; + + // Whether to negate the Condition. If true, the Condition becomes a NAND over + // its non-empty fields, each field must be false for the Condition overall to + // be satisfied. Defaults to false. + bool negate = 5; + + // The request must be made by one of the provided user or service + // accounts. Groups are not supported. + // Syntax: + // `user:{emailid}` + // `serviceAccount:{emailid}` + // If not specified, a request may come from any user. + repeated string members = 6; + + // The request must originate from one of the provided countries/regions. + // Must be valid ISO 3166-1 alpha-2 codes. + repeated string regions = 7; +} + +// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +// to represent the necessary conditions for the level to apply to a request. +// See CEL spec at: https://github.com/google/cel-spec +message CustomLevel { + // Required. A Cloud CEL expression evaluating to a boolean. + google.type.Expr expr = 1; +} + +// `DevicePolicy` specifies device specific restrictions necessary to acquire a +// given access level. A `DevicePolicy` specifies requirements for requests from +// devices to be granted access levels, it does not do any enforcement on the +// device. `DevicePolicy` acts as an AND over all specified fields, and each +// repeated field is an OR over its elements. Any unset fields are ignored. For +// example, if the proto is { os_type : DESKTOP_WINDOWS, os_type : +// DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be +// true for requests originating from encrypted Linux desktops and encrypted +// Windows desktops. +message DevicePolicy { + // Whether or not screenlock is required for the DevicePolicy to be true. + // Defaults to `false`. + bool require_screenlock = 1; + + // Allowed encryptions statuses, an empty list allows all statuses. + repeated google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + + // Allowed OS versions, an empty list allows all types and all versions. + repeated OsConstraint os_constraints = 3; + + // Allowed device management levels, an empty list allows all management + // levels. + repeated google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + + // Whether the device needs to be approved by the customer admin. + bool require_admin_approval = 7; + + // Whether the device needs to be corp owned. + bool require_corp_owned = 8; +} + +// A restriction on the OS type and version of devices making requests. +message OsConstraint { + // Required. The allowed OS type. + google.identity.accesscontextmanager.type.OsType os_type = 1; + + // The minimum allowed OS version. If not set, any version of this OS + // satisfies the constraint. Format: `"major.minor.patch"`. + // Examples: `"10.5.301"`, `"9.2.1"`. + string minimum_version = 2; + + // Only allows requests from devices with a verified Chrome OS. + // Verifications includes requirements that the device is enterprise-managed, + // conformant to domain policies, and the caller has permission to call + // the API targeted by the request. + bool require_verified_chrome_os = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto new file mode 100644 index 00000000000..65b574d9375 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto @@ -0,0 +1,81 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// `AccessPolicy` is a container for `AccessLevels` (which define the necessary +// attributes to use Google Cloud services) and `ServicePerimeters` (which +// define regions of services able to freely pass data within a perimeter). An +// access policy is globally visible within an organization, and the +// restrictions it specifies apply to all projects within an organization. +message AccessPolicy { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + pattern: "accessPolicies/{access_policy}" + }; + + // Output only. Resource name of the `AccessPolicy`. Format: + // `accessPolicies/{access_policy}` + string name = 1; + + // Required. The parent of this `AccessPolicy` in the Cloud Resource + // Hierarchy. Currently immutable once created. Format: + // `organizations/{organization_id}` + string parent = 2; + + // Required. Human readable title. Does not affect behavior. + string title = 3; + + // The scopes of a policy define which resources an ACM policy can restrict, + // and where ACM resources can be referenced. + // For example, a policy with scopes=["folders/123"] has the following + // behavior: + // - vpcsc perimeters can only restrict projects within folders/123 + // - access levels can only be referenced by resources within folders/123. + // If empty, there are no limitations on which resources can be restricted by + // an ACM policy, and there are no limitations on where ACM resources can be + // referenced. + // Only one policy can include a given scope (attempting to create a second + // policy which includes "folders/123" will result in an error). + // Currently, scopes cannot be modified after a policy is created. + // Currently, policies can only have a single scope. + // Format: list of `folders/{folder_number}` or `projects/{project_number}` + repeated string scopes = 7; + + // Output only. Time the `AccessPolicy` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `AccessPolicy` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Output only. An opaque identifier for the current version of the + // `AccessPolicy`. This will always be a strongly validated etag, meaning that + // two Access Polices will be identical if and only if their etags are + // identical. Clients should not expect this to be in any specific format. + string etag = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto new file mode 100644 index 00000000000..ced18e9f9ed --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto @@ -0,0 +1,68 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "GcpUserAccessBindingProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// Restricts access to Cloud Console and Google Cloud APIs for a set of users +// using Context-Aware Access. +message GcpUserAccessBinding { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + pattern: "organizations/{organization}/gcpUserAccessBindings/{gcp_user_access_binding}" + }; + + // Immutable. Assigned by the server during creation. The last segment has an arbitrary + // length and has only URI unreserved characters (as defined by + // [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)). + // Should not be specified by the client during creation. + // Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. Google Group id whose members are subject to this binding's restrictions. + // See "id" in the [G Suite Directory API's Groups resource] + // (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource). + // If a group's email address/alias is changed, this resource will continue + // to point at the changed group. This field does not accept group email + // addresses or aliases. + // Example: "01d520gv4vjcrht" + string group_key = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Access level that a user must have to be granted access. Only one access + // level is supported, not multiple. This repeated field must have exactly + // one element. + // Example: "accessPolicies/9522/accessLevels/device_trusted" + repeated string access_levels = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto new file mode 100644 index 00000000000..d135380e788 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto @@ -0,0 +1,472 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "ServicePerimeterProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// `ServicePerimeter` describes a set of Google Cloud resources which can freely +// import and export data amongst themselves, but not export outside of the +// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` +// has a target outside of the `ServicePerimeter`, the request will be blocked. +// Otherwise the request is allowed. There are two types of Service Perimeter - +// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +// Google Cloud project can only belong to a single regular Service Perimeter. +// Service Perimeter Bridges can contain only Google Cloud projects as members, +// a single Google Cloud project may belong to multiple Service Perimeter +// Bridges. +message ServicePerimeter { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + pattern: "accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}" + }; + + // Specifies the type of the Perimeter. There are two types: regular and + // bridge. Regular Service Perimeter contains resources, access levels, and + // restricted services. Every resource can be in at most ONE + // regular Service Perimeter. + // + // In addition to being in a regular service perimeter, a resource can also + // be in zero or more perimeter bridges. A perimeter bridge only contains + // resources. Cross project operations are permitted if all effected + // resources share some perimeter (whether bridge or regular). Perimeter + // Bridge does not contain access levels or services: those are governed + // entirely by the regular perimeter that resource is in. + // + // Perimeter Bridges are typically useful when building more complex toplogies + // with many independent perimeters that need to share some data with a common + // perimeter, but should not be able to share data among themselves. + enum PerimeterType { + // Regular Perimeter. + PERIMETER_TYPE_REGULAR = 0; + + // Perimeter Bridge. + PERIMETER_TYPE_BRIDGE = 1; + } + + // Required. Resource name for the ServicePerimeter. The `short_name` + // component must begin with a letter and only include alphanumeric and '_'. + // Format: + // `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}` + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `ServicePerimeter` and its use. Does not affect + // behavior. + string description = 3; + + // Output only. Time the `ServicePerimeter` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `ServicePerimeter` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Perimeter type indicator. A single project is + // allowed to be a member of single regular perimeter, but multiple service + // perimeter bridges. A project cannot be a included in a perimeter bridge + // without being included in regular perimeter. For perimeter bridges, + // the restricted service list as well as access level lists must be + // empty. + PerimeterType perimeter_type = 6; + + // Current ServicePerimeter configuration. Specifies sets of resources, + // restricted services and access levels that determine perimeter + // content and boundaries. + ServicePerimeterConfig status = 7; + + // Proposed (or dry run) ServicePerimeter configuration. This configuration + // allows to specify and test ServicePerimeter configuration without enforcing + // actual access restrictions. Only allowed to be set when the + // "use_explicit_dry_run_spec" flag is set. + ServicePerimeterConfig spec = 8; + + // Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly + // exists for all Service Perimeters, and that spec is identical to the + // status for those Service Perimeters. When this flag is set, it inhibits the + // generation of the implicit spec, thereby allowing the user to explicitly + // provide a configuration ("spec") to use in a dry-run version of the Service + // Perimeter. This allows the user to test changes to the enforced config + // ("status") without actually enforcing them. This testing is done through + // analyzing the differences between currently enforced and suggested + // restrictions. use_explicit_dry_run_spec must bet set to True if any of the + // fields in the spec are set to non-default values. + bool use_explicit_dry_run_spec = 9; +} + +// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +// describe specific Service Perimeter configuration. +message ServicePerimeterConfig { + // Specifies how APIs are allowed to communicate within the Service + // Perimeter. + message VpcAccessibleServices { + // Whether to restrict API calls within the Service Perimeter to the list of + // APIs specified in 'allowed_services'. + bool enable_restriction = 1; + + // The list of APIs usable within the Service Perimeter. Must be empty + // unless 'enable_restriction' is True. You can specify a list of individual + // services, as well as include the 'RESTRICTED-SERVICES' value, which + // automatically includes all of the services protected by the perimeter. + repeated string allowed_services = 2; + } + + // Specifies the types of identities that are allowed access in either + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] + // or [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom] + // rules. + enum IdentityType { + // No blanket identity group specified. + IDENTITY_TYPE_UNSPECIFIED = 0; + + // Authorize access from all identities outside the perimeter. + ANY_IDENTITY = 1; + + // Authorize access from all human users outside the perimeter. + ANY_USER_ACCOUNT = 2; + + // Authorize access from all service accounts outside the perimeter. + ANY_SERVICE_ACCOUNT = 3; + } + + // An allowed method or permission of a service specified in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + message MethodSelector { + // The API method name or Cloud IAM permission name to allow. + oneof kind { + // Value for `method` should be a valid method name for the corresponding + // `service_name` in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + // If `*` used as value for `method`, then ALL methods and permissions are + // allowed. + string method = 1; + + // Value for `permission` should be a valid Cloud IAM permission for the + // corresponding `service_name` in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + string permission = 2; + } + } + + // Identification for an API Operation. + message ApiOperation { + // The name of the API whose methods or permissions the [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // or [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // want to allow. A single [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // with `service_name` field set to `*` will allow all methods AND + // permissions for all services. + string service_name = 1; + + // API methods or permissions to allow. Method or permission must belong to + // the service specified by `service_name` field. A single [MethodSelector] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector] + // entry with `*` specified for the `method` field will allow all methods + // AND permissions for the service specified in `service_name`. + repeated MethodSelector method_selectors = 2; + } + + // The source that [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // authorizes access from. + message IngressSource { + // Allowed ingress source. It can be one of [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] or Google + // Cloud resource. + oneof source { + // An [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] resource + // name that allow resources within the [ServicePerimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to be + // accessed from the internet. [AccessLevels] + // [google.identity.accesscontextmanager.v1.AccessLevel] listed must + // be in the same policy as this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // Referencing a nonexistent [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] will cause + // an error. If no [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `accessPolicies/MY_POLICY/accessLevels/MY_LEVEL`. If a single `*` is + // specified for `access_level`, then all [IngressSources] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource] + // will be allowed. + string access_level = 1; + + // A Google Cloud resource that is allowed to ingress the perimeter. + // Requests from these resources will be allowed to access perimeter data. + // Currently only projects are allowed. + // Format: `projects/{project_number}` + // The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, the + // case of allowing all Google Cloud resources only is not supported. + string resource = 2; + } + } + + // Defines the conditions under which an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request. Conditions are based on information about the source of + // the request. The request must satisfy what is defined in `sources` AND + // identity related fields in order to match. + message IngressFrom { + // Sources that this [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // authorizes access from. + repeated IngressSource sources = 1; + + // A list of identities that are allowed access through this ingress + // policy. Should be in the format of email address. The email address + // should represent individual user or service account only. + repeated string identities = 2; + + // Specifies the type of identities that are allowed access from outside the + // perimeter. If left unspecified, then members of `identities` field will + // be allowed access. + IdentityType identity_type = 3; + } + + // Defines the conditions under which an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request. Conditions are based on information about the + // [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // intended to be performed on the target resource of the request. The request + // must satisfy what is defined in `operations` AND `resources` in order to + // match. + message IngressTo { + // A list of [ApiOperations] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // allowed to be performed by the sources specified in corresponding + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] + // in this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + repeated ApiOperation operations = 1; + + // A list of resources, currently only projects in the form + // `projects/`, protected by this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] that are + // allowed to be accessed by sources defined in the corresponding + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom]. + // If a single `*` is specified, then access to all resources inside the + // perimeter are allowed. + repeated string resources = 2; + } + + // Policy for ingress into [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // match requests based on `ingress_from` and `ingress_to` stanzas. For an + // ingress policy to match, both the `ingress_from` and `ingress_to` stanzas + // must be matched. If an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request, the request is allowed through the perimeter boundary + // from outside the perimeter. + // + // For example, access from the internet can be allowed either + // based on an [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] or, for traffic + // hosted on Google Cloud, the project of the source network. For access from + // private networks, using the project of the hosting network is required. + // + // Individual ingress policies can be limited by restricting which + // services and/or actions they match using the `ingress_to` field. + message IngressPolicy { + // Defines the conditions on the source of a request causing this + // [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply. + IngressFrom ingress_from = 1; + + // Defines the conditions on the [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // and request destination that cause this [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply. + IngressTo ingress_to = 2; + } + + // Defines the conditions under which an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request. Conditions based on information about the source of the + // request. Note that if the destination of the request is also protected by a + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + // an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // which allows access in order for this request to succeed. + message EgressFrom { + // A list of identities that are allowed access through this [EgressPolicy]. + // Should be in the format of email address. The email address should + // represent individual user or service account only. + repeated string identities = 1; + + // Specifies the type of identities that are allowed access to outside the + // perimeter. If left unspecified, then members of `identities` field will + // be allowed access. + IdentityType identity_type = 2; + } + + // Defines the conditions under which an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request. Conditions are based on information about the + // [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // intended to be performed on the `resources` specified. Note that if the + // destination of the request is also protected by a [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + // an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // which allows access in order for this request to succeed. The request must + // match `operations` AND `resources` fields in order to be allowed egress out + // of the perimeter. + message EgressTo { + // A list of resources, currently only projects in the form + // `projects/`, that are allowed to be accessed by sources + // defined in the corresponding [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + // A request matches if it contains a resource in this list. If `*` is + // specified for `resources`, then this [EgressTo] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo] + // rule will authorize access to all resources outside the perimeter. + repeated string resources = 1; + + // A list of [ApiOperations] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // allowed to be performed by the sources specified in the corresponding + // [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + // A request matches if it uses an operation/service in this list. + repeated ApiOperation operations = 2; + + // A list of external resources that are allowed to be accessed. Only AWS + // and Azure resources are supported. For Amazon S3, the supported format is + // s3://BUCKET_NAME. For Azure Storage, the supported format is + // azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches + // if it contains an external resource in this list (Example: + // s3://bucket/path). Currently '*' is not allowed. + repeated string external_resources = 3; + } + + // Policy for egress from perimeter. + // + // [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // match requests based on `egress_from` and `egress_to` stanzas. For an + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to match, both `egress_from` and `egress_to` stanzas must be matched. If an + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request, the request is allowed to span the [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] boundary. + // For example, an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // can be used to allow VMs on networks within the [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to access a + // defined set of projects outside the perimeter in certain contexts (e.g. to + // read data from a Cloud Storage bucket or query against a BigQuery dataset). + // + // [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // are concerned with the *resources* that a request relates as well as the + // API services and API actions being used. They do not related to the + // direction of data movement. More detailed documentation for this concept + // can be found in the descriptions of [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom] + // and [EgressTo] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo]. + message EgressPolicy { + // Defines conditions on the source of a request causing this [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply. + EgressFrom egress_from = 1; + + // Defines the conditions on the [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // and destination resources that cause this [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply. + EgressTo egress_to = 2; + } + + // A list of Google Cloud resources that are inside of the service perimeter. + // Currently only projects are allowed. Format: `projects/{project_number}` + repeated string resources = 1; + + // A list of `AccessLevel` resource names that allow resources within the + // `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed + // must be in the same policy as this `ServicePerimeter`. Referencing a + // nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. + // For Service Perimeter Bridge, must be empty. + repeated string access_levels = 2; + + // Google Cloud services that are subject to the Service Perimeter + // restrictions. For example, if `storage.googleapis.com` is specified, access + // to the storage buckets inside the perimeter must meet the perimeter's + // access restrictions. + repeated string restricted_services = 4; + + // Configuration for APIs allowed within Perimeter. + VpcAccessibleServices vpc_accessible_services = 10; + + // List of [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply to the perimeter. A perimeter may have multiple [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy], + // each of which is evaluated separately. Access is granted if any [Ingress + // Policy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // grants it. Must be empty for a perimeter bridge. + repeated IngressPolicy ingress_policies = 8; + + // List of [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply to the perimeter. A perimeter may have multiple [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy], + // each of which is evaluated separately. Access is granted if any + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // grants it. Must be empty for a perimeter bridge. + repeated EgressPolicy egress_policies = 9; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.d.ts b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.d.ts new file mode 100644 index 00000000000..1bd5c9fe643 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.d.ts @@ -0,0 +1,10973 @@ +// Copyright 2024 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace asset. */ + namespace asset { + + /** Namespace v1p5beta1. */ + namespace v1p5beta1 { + + /** 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 ListAssets. + * @param request ListAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAssetsResponse + */ + public listAssets(request: google.cloud.asset.v1p5beta1.IListAssetsRequest, callback: google.cloud.asset.v1p5beta1.AssetService.ListAssetsCallback): void; + + /** + * Calls ListAssets. + * @param request ListAssetsRequest message or plain object + * @returns Promise + */ + public listAssets(request: google.cloud.asset.v1p5beta1.IListAssetsRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1p5beta1.AssetService|listAssets}. + * @param error Error, if any + * @param [response] ListAssetsResponse + */ + type ListAssetsCallback = (error: (Error|null), response?: google.cloud.asset.v1p5beta1.ListAssetsResponse) => void; + } + + /** Properties of a ListAssetsRequest. */ + interface IListAssetsRequest { + + /** ListAssetsRequest parent */ + parent?: (string|null); + + /** ListAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ListAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1p5beta1.ContentType|keyof typeof google.cloud.asset.v1p5beta1.ContentType|null); + + /** ListAssetsRequest pageSize */ + pageSize?: (number|null); + + /** ListAssetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAssetsRequest. */ + class ListAssetsRequest implements IListAssetsRequest { + + /** + * Constructs a new ListAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p5beta1.IListAssetsRequest); + + /** ListAssetsRequest parent. */ + public parent: string; + + /** ListAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ListAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1p5beta1.ContentType|keyof typeof google.cloud.asset.v1p5beta1.ContentType); + + /** ListAssetsRequest pageSize. */ + public pageSize: number; + + /** ListAssetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1p5beta1.IListAssetsRequest): google.cloud.asset.v1p5beta1.ListAssetsRequest; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p5beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsRequest.verify|verify} messages. + * @param message ListAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p5beta1.IListAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsRequest + * @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.v1p5beta1.ListAssetsRequest; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsRequest + * @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.v1p5beta1.ListAssetsRequest; + + /** + * Verifies a ListAssetsRequest 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 ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p5beta1.ListAssetsRequest; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @param message ListAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p5beta1.ListAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListAssetsResponse. */ + interface IListAssetsResponse { + + /** ListAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse assets */ + assets?: (google.cloud.asset.v1p5beta1.IAsset[]|null); + + /** ListAssetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAssetsResponse. */ + class ListAssetsResponse implements IListAssetsResponse { + + /** + * Constructs a new ListAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p5beta1.IListAssetsResponse); + + /** ListAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ListAssetsResponse assets. */ + public assets: google.cloud.asset.v1p5beta1.IAsset[]; + + /** ListAssetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1p5beta1.IListAssetsResponse): google.cloud.asset.v1p5beta1.ListAssetsResponse; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p5beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsResponse.verify|verify} messages. + * @param message ListAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p5beta1.IListAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAssetsResponse + * @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.v1p5beta1.ListAssetsResponse; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAssetsResponse + * @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.v1p5beta1.ListAssetsResponse; + + /** + * Verifies a ListAssetsResponse 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 ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p5beta1.ListAssetsResponse; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @param message ListAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p5beta1.ListAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5 + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1p5beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p5beta1.IAsset); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1p5beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1p5beta1.IAsset): google.cloud.asset.v1p5beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p5beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p5beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p5beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p5beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p5beta1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p5beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p5beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p5beta1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1p5beta1.IResource): google.cloud.asset.v1p5beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p5beta1.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.v1p5beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.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.v1p5beta1.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.v1p5beta1.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.v1p5beta1.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.v1p5beta1.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.v1p5beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace orgpolicy. */ + namespace orgpolicy { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy constraint */ + constraint?: (string|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + + /** Policy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Policy listPolicy */ + listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); + + /** Policy booleanPolicy */ + booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); + + /** Policy restoreDefault */ + restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy constraint. */ + public constraint: string; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** Policy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Policy listPolicy. */ + public listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); + + /** Policy booleanPolicy. */ + public booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); + + /** Policy restoreDefault. */ + public restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + + /** Policy policyType. */ + public policyType?: ("listPolicy"|"booleanPolicy"|"restoreDefault"); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.IPolicy): google.cloud.orgpolicy.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.orgpolicy.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.orgpolicy.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Policy { + + /** Properties of a ListPolicy. */ + interface IListPolicy { + + /** ListPolicy allowedValues */ + allowedValues?: (string[]|null); + + /** ListPolicy deniedValues */ + deniedValues?: (string[]|null); + + /** ListPolicy allValues */ + allValues?: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null); + + /** ListPolicy suggestedValue */ + suggestedValue?: (string|null); + + /** ListPolicy inheritFromParent */ + inheritFromParent?: (boolean|null); + } + + /** Represents a ListPolicy. */ + class ListPolicy implements IListPolicy { + + /** + * Constructs a new ListPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy); + + /** ListPolicy allowedValues. */ + public allowedValues: string[]; + + /** ListPolicy deniedValues. */ + public deniedValues: string[]; + + /** ListPolicy allValues. */ + public allValues: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues); + + /** ListPolicy suggestedValue. */ + public suggestedValue: string; + + /** ListPolicy inheritFromParent. */ + public inheritFromParent: boolean; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; + + /** + * Verifies a ListPolicy 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 ListPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @param message ListPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.ListPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListPolicy { + + /** AllValues enum. */ + enum AllValues { + ALL_VALUES_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + } + + /** Properties of a BooleanPolicy. */ + interface IBooleanPolicy { + + /** BooleanPolicy enforced */ + enforced?: (boolean|null); + } + + /** Represents a BooleanPolicy. */ + class BooleanPolicy implements IBooleanPolicy { + + /** + * Constructs a new BooleanPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy); + + /** BooleanPolicy enforced. */ + public enforced: boolean; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BooleanPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Verifies a BooleanPolicy 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 BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BooleanPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @param message BooleanPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.BooleanPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BooleanPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BooleanPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDefault. */ + interface IRestoreDefault { + } + + /** Represents a RestoreDefault. */ + class RestoreDefault implements IRestoreDefault { + + /** + * Constructs a new RestoreDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault); + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDefault instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Verifies a RestoreDefault 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 RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDefault + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @param message RestoreDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.RestoreDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace identity. */ + namespace identity { + + /** Namespace accesscontextmanager. */ + namespace accesscontextmanager { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AccessLevel. */ + interface IAccessLevel { + + /** AccessLevel name */ + name?: (string|null); + + /** AccessLevel title */ + title?: (string|null); + + /** AccessLevel description */ + description?: (string|null); + + /** AccessLevel basic */ + basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom */ + custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AccessLevel. */ + class AccessLevel implements IAccessLevel { + + /** + * Constructs a new AccessLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessLevel); + + /** AccessLevel name. */ + public name: string; + + /** AccessLevel title. */ + public title: string; + + /** AccessLevel description. */ + public description: string; + + /** AccessLevel basic. */ + public basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom. */ + public custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel level. */ + public level?: ("basic"|"custom"); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessLevel): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Verifies an AccessLevel 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 AccessLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @param message AccessLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BasicLevel. */ + interface IBasicLevel { + + /** BasicLevel conditions */ + conditions?: (google.identity.accesscontextmanager.v1.ICondition[]|null); + + /** BasicLevel combiningFunction */ + combiningFunction?: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null); + } + + /** Represents a BasicLevel. */ + class BasicLevel implements IBasicLevel { + + /** + * Constructs a new BasicLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IBasicLevel); + + /** BasicLevel conditions. */ + public conditions: google.identity.accesscontextmanager.v1.ICondition[]; + + /** BasicLevel combiningFunction. */ + public combiningFunction: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction); + + /** + * Creates a new BasicLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IBasicLevel): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Verifies a BasicLevel 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 BasicLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @param message BasicLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.BasicLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BasicLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BasicLevel { + + /** ConditionCombiningFunction enum. */ + enum ConditionCombiningFunction { + AND = 0, + OR = 1 + } + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition ipSubnetworks */ + ipSubnetworks?: (string[]|null); + + /** Condition devicePolicy */ + devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels */ + requiredAccessLevels?: (string[]|null); + + /** Condition negate */ + negate?: (boolean|null); + + /** Condition members */ + members?: (string[]|null); + + /** Condition regions */ + regions?: (string[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICondition); + + /** Condition ipSubnetworks. */ + public ipSubnetworks: string[]; + + /** Condition devicePolicy. */ + public devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels. */ + public requiredAccessLevels: string[]; + + /** Condition negate. */ + public negate: boolean; + + /** Condition members. */ + public members: string[]; + + /** Condition regions. */ + public regions: string[]; + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICondition): google.identity.accesscontextmanager.v1.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Verifies a Condition 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 Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomLevel. */ + interface ICustomLevel { + + /** CustomLevel expr */ + expr?: (google.type.IExpr|null); + } + + /** Represents a CustomLevel. */ + class CustomLevel implements ICustomLevel { + + /** + * Constructs a new CustomLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICustomLevel); + + /** CustomLevel expr. */ + public expr?: (google.type.IExpr|null); + + /** + * Creates a new CustomLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICustomLevel): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Verifies a CustomLevel 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 CustomLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @param message CustomLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.CustomLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DevicePolicy. */ + interface IDevicePolicy { + + /** DevicePolicy requireScreenlock */ + requireScreenlock?: (boolean|null); + + /** DevicePolicy allowedEncryptionStatuses */ + allowedEncryptionStatuses?: (google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]|null); + + /** DevicePolicy osConstraints */ + osConstraints?: (google.identity.accesscontextmanager.v1.IOsConstraint[]|null); + + /** DevicePolicy allowedDeviceManagementLevels */ + allowedDeviceManagementLevels?: (google.identity.accesscontextmanager.type.DeviceManagementLevel[]|null); + + /** DevicePolicy requireAdminApproval */ + requireAdminApproval?: (boolean|null); + + /** DevicePolicy requireCorpOwned */ + requireCorpOwned?: (boolean|null); + } + + /** Represents a DevicePolicy. */ + class DevicePolicy implements IDevicePolicy { + + /** + * Constructs a new DevicePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy); + + /** DevicePolicy requireScreenlock. */ + public requireScreenlock: boolean; + + /** DevicePolicy allowedEncryptionStatuses. */ + public allowedEncryptionStatuses: google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]; + + /** DevicePolicy osConstraints. */ + public osConstraints: google.identity.accesscontextmanager.v1.IOsConstraint[]; + + /** DevicePolicy allowedDeviceManagementLevels. */ + public allowedDeviceManagementLevels: google.identity.accesscontextmanager.type.DeviceManagementLevel[]; + + /** DevicePolicy requireAdminApproval. */ + public requireAdminApproval: boolean; + + /** DevicePolicy requireCorpOwned. */ + public requireCorpOwned: boolean; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DevicePolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Verifies a DevicePolicy 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 DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DevicePolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @param message DevicePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.DevicePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DevicePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DevicePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OsConstraint. */ + interface IOsConstraint { + + /** OsConstraint osType */ + osType?: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType|null); + + /** OsConstraint minimumVersion */ + minimumVersion?: (string|null); + + /** OsConstraint requireVerifiedChromeOs */ + requireVerifiedChromeOs?: (boolean|null); + } + + /** Represents an OsConstraint. */ + class OsConstraint implements IOsConstraint { + + /** + * Constructs a new OsConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IOsConstraint); + + /** OsConstraint osType. */ + public osType: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType); + + /** OsConstraint minimumVersion. */ + public minimumVersion: string; + + /** OsConstraint requireVerifiedChromeOs. */ + public requireVerifiedChromeOs: boolean; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns OsConstraint instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IOsConstraint): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Verifies an OsConstraint 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 OsConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsConstraint + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @param message OsConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.OsConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessPolicy. */ + interface IAccessPolicy { + + /** AccessPolicy name */ + name?: (string|null); + + /** AccessPolicy parent */ + parent?: (string|null); + + /** AccessPolicy title */ + title?: (string|null); + + /** AccessPolicy scopes */ + scopes?: (string[]|null); + + /** AccessPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag */ + etag?: (string|null); + } + + /** Represents an AccessPolicy. */ + class AccessPolicy implements IAccessPolicy { + + /** + * Constructs a new AccessPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy); + + /** AccessPolicy name. */ + public name: string; + + /** AccessPolicy parent. */ + public parent: string; + + /** AccessPolicy title. */ + public title: string; + + /** AccessPolicy scopes. */ + public scopes: string[]; + + /** AccessPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag. */ + public etag: string; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Verifies an AccessPolicy 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 AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @param message AccessPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicePerimeter. */ + interface IServicePerimeter { + + /** ServicePerimeter name */ + name?: (string|null); + + /** ServicePerimeter title */ + title?: (string|null); + + /** ServicePerimeter description */ + description?: (string|null); + + /** ServicePerimeter createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType */ + perimeterType?: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null); + + /** ServicePerimeter status */ + status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec */ + spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec */ + useExplicitDryRunSpec?: (boolean|null); + } + + /** Represents a ServicePerimeter. */ + class ServicePerimeter implements IServicePerimeter { + + /** + * Constructs a new ServicePerimeter. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter); + + /** ServicePerimeter name. */ + public name: string; + + /** ServicePerimeter title. */ + public title: string; + + /** ServicePerimeter description. */ + public description: string; + + /** ServicePerimeter createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType. */ + public perimeterType: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType); + + /** ServicePerimeter status. */ + public status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec. */ + public spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec. */ + public useExplicitDryRunSpec: boolean; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeter instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Verifies a ServicePerimeter 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 ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeter + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @param message ServicePerimeter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServicePerimeter { + + /** PerimeterType enum. */ + enum PerimeterType { + PERIMETER_TYPE_REGULAR = 0, + PERIMETER_TYPE_BRIDGE = 1 + } + } + + /** Properties of a ServicePerimeterConfig. */ + interface IServicePerimeterConfig { + + /** ServicePerimeterConfig resources */ + resources?: (string[]|null); + + /** ServicePerimeterConfig accessLevels */ + accessLevels?: (string[]|null); + + /** ServicePerimeterConfig restrictedServices */ + restrictedServices?: (string[]|null); + + /** ServicePerimeterConfig vpcAccessibleServices */ + vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** ServicePerimeterConfig ingressPolicies */ + ingressPolicies?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy[]|null); + + /** ServicePerimeterConfig egressPolicies */ + egressPolicies?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy[]|null); + } + + /** Represents a ServicePerimeterConfig. */ + class ServicePerimeterConfig implements IServicePerimeterConfig { + + /** + * Constructs a new ServicePerimeterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig); + + /** ServicePerimeterConfig resources. */ + public resources: string[]; + + /** ServicePerimeterConfig accessLevels. */ + public accessLevels: string[]; + + /** ServicePerimeterConfig restrictedServices. */ + public restrictedServices: string[]; + + /** ServicePerimeterConfig vpcAccessibleServices. */ + public vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** ServicePerimeterConfig ingressPolicies. */ + public ingressPolicies: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy[]; + + /** ServicePerimeterConfig egressPolicies. */ + public egressPolicies: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy[]; + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeterConfig instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Verifies a ServicePerimeterConfig 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 ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeterConfig + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @param message ServicePerimeterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServicePerimeterConfig { + + /** Properties of a VpcAccessibleServices. */ + interface IVpcAccessibleServices { + + /** VpcAccessibleServices enableRestriction */ + enableRestriction?: (boolean|null); + + /** VpcAccessibleServices allowedServices */ + allowedServices?: (string[]|null); + } + + /** Represents a VpcAccessibleServices. */ + class VpcAccessibleServices implements IVpcAccessibleServices { + + /** + * Constructs a new VpcAccessibleServices. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices); + + /** VpcAccessibleServices enableRestriction. */ + public enableRestriction: boolean; + + /** VpcAccessibleServices allowedServices. */ + public allowedServices: string[]; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcAccessibleServices instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Verifies a VpcAccessibleServices 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 VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcAccessibleServices + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @param message VpcAccessibleServices + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcAccessibleServices + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IdentityType enum. */ + enum IdentityType { + IDENTITY_TYPE_UNSPECIFIED = 0, + ANY_IDENTITY = 1, + ANY_USER_ACCOUNT = 2, + ANY_SERVICE_ACCOUNT = 3 + } + + /** Properties of a MethodSelector. */ + interface IMethodSelector { + + /** MethodSelector method */ + method?: (string|null); + + /** MethodSelector permission */ + permission?: (string|null); + } + + /** Represents a MethodSelector. */ + class MethodSelector implements IMethodSelector { + + /** + * Constructs a new MethodSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector); + + /** MethodSelector method. */ + public method?: (string|null); + + /** MethodSelector permission. */ + public permission?: (string|null); + + /** MethodSelector kind. */ + public kind?: ("method"|"permission"); + + /** + * Creates a new MethodSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSelector instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Encodes the specified MethodSelector message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @param message MethodSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSelector message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @param message MethodSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSelector + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Decodes a MethodSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSelector + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Verifies a MethodSelector 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 MethodSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSelector + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Creates a plain object from a MethodSelector message. Also converts values to other types if specified. + * @param message MethodSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiOperation. */ + interface IApiOperation { + + /** ApiOperation serviceName */ + serviceName?: (string|null); + + /** ApiOperation methodSelectors */ + methodSelectors?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector[]|null); + } + + /** Represents an ApiOperation. */ + class ApiOperation implements IApiOperation { + + /** + * Constructs a new ApiOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation); + + /** ApiOperation serviceName. */ + public serviceName: string; + + /** ApiOperation methodSelectors. */ + public methodSelectors: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector[]; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiOperation instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiOperation + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiOperation + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Verifies an ApiOperation 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 ApiOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiOperation + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @param message ApiOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressSource. */ + interface IIngressSource { + + /** IngressSource accessLevel */ + accessLevel?: (string|null); + + /** IngressSource resource */ + resource?: (string|null); + } + + /** Represents an IngressSource. */ + class IngressSource implements IIngressSource { + + /** + * Constructs a new IngressSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource); + + /** IngressSource accessLevel. */ + public accessLevel?: (string|null); + + /** IngressSource resource. */ + public resource?: (string|null); + + /** IngressSource source. */ + public source?: ("accessLevel"|"resource"); + + /** + * Creates a new IngressSource instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressSource instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Encodes the specified IngressSource message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @param message IngressSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressSource message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @param message IngressSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressSource + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Decodes an IngressSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressSource + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Verifies an IngressSource 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 IngressSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressSource + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Creates a plain object from an IngressSource message. Also converts values to other types if specified. + * @param message IngressSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressFrom. */ + interface IIngressFrom { + + /** IngressFrom sources */ + sources?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource[]|null); + + /** IngressFrom identities */ + identities?: (string[]|null); + + /** IngressFrom identityType */ + identityType?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null); + } + + /** Represents an IngressFrom. */ + class IngressFrom implements IIngressFrom { + + /** + * Constructs a new IngressFrom. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom); + + /** IngressFrom sources. */ + public sources: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource[]; + + /** IngressFrom identities. */ + public identities: string[]; + + /** IngressFrom identityType. */ + public identityType: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType); + + /** + * Creates a new IngressFrom instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressFrom instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Encodes the specified IngressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @param message IngressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @param message IngressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressFrom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Decodes an IngressFrom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Verifies an IngressFrom 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 IngressFrom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressFrom + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Creates a plain object from an IngressFrom message. Also converts values to other types if specified. + * @param message IngressFrom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressFrom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressFrom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressTo. */ + interface IIngressTo { + + /** IngressTo operations */ + operations?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]|null); + + /** IngressTo resources */ + resources?: (string[]|null); + } + + /** Represents an IngressTo. */ + class IngressTo implements IIngressTo { + + /** + * Constructs a new IngressTo. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo); + + /** IngressTo operations. */ + public operations: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]; + + /** IngressTo resources. */ + public resources: string[]; + + /** + * Creates a new IngressTo instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressTo instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Encodes the specified IngressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @param message IngressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @param message IngressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressTo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Decodes an IngressTo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Verifies an IngressTo 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 IngressTo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressTo + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Creates a plain object from an IngressTo message. Also converts values to other types if specified. + * @param message IngressTo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressTo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressTo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressPolicy. */ + interface IIngressPolicy { + + /** IngressPolicy ingressFrom */ + ingressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null); + + /** IngressPolicy ingressTo */ + ingressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null); + } + + /** Represents an IngressPolicy. */ + class IngressPolicy implements IIngressPolicy { + + /** + * Constructs a new IngressPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy); + + /** IngressPolicy ingressFrom. */ + public ingressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null); + + /** IngressPolicy ingressTo. */ + public ingressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null); + + /** + * Creates a new IngressPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Encodes the specified IngressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @param message IngressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @param message IngressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Verifies an IngressPolicy 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 IngressPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Creates a plain object from an IngressPolicy message. Also converts values to other types if specified. + * @param message IngressPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressFrom. */ + interface IEgressFrom { + + /** EgressFrom identities */ + identities?: (string[]|null); + + /** EgressFrom identityType */ + identityType?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null); + } + + /** Represents an EgressFrom. */ + class EgressFrom implements IEgressFrom { + + /** + * Constructs a new EgressFrom. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom); + + /** EgressFrom identities. */ + public identities: string[]; + + /** EgressFrom identityType. */ + public identityType: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType); + + /** + * Creates a new EgressFrom instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressFrom instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Encodes the specified EgressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @param message EgressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @param message EgressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressFrom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Decodes an EgressFrom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Verifies an EgressFrom 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 EgressFrom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressFrom + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Creates a plain object from an EgressFrom message. Also converts values to other types if specified. + * @param message EgressFrom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressFrom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressFrom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressTo. */ + interface IEgressTo { + + /** EgressTo resources */ + resources?: (string[]|null); + + /** EgressTo operations */ + operations?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]|null); + + /** EgressTo externalResources */ + externalResources?: (string[]|null); + } + + /** Represents an EgressTo. */ + class EgressTo implements IEgressTo { + + /** + * Constructs a new EgressTo. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo); + + /** EgressTo resources. */ + public resources: string[]; + + /** EgressTo operations. */ + public operations: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]; + + /** EgressTo externalResources. */ + public externalResources: string[]; + + /** + * Creates a new EgressTo instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressTo instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Encodes the specified EgressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @param message EgressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @param message EgressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressTo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Decodes an EgressTo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Verifies an EgressTo 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 EgressTo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressTo + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Creates a plain object from an EgressTo message. Also converts values to other types if specified. + * @param message EgressTo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressTo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressTo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressPolicy. */ + interface IEgressPolicy { + + /** EgressPolicy egressFrom */ + egressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null); + + /** EgressPolicy egressTo */ + egressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null); + } + + /** Represents an EgressPolicy. */ + class EgressPolicy implements IEgressPolicy { + + /** + * Constructs a new EgressPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy); + + /** EgressPolicy egressFrom. */ + public egressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null); + + /** EgressPolicy egressTo. */ + public egressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null); + + /** + * Creates a new EgressPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Encodes the specified EgressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @param message EgressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @param message EgressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Verifies an EgressPolicy 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 EgressPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Creates a plain object from an EgressPolicy message. Also converts values to other types if specified. + * @param message EgressPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace type. */ + namespace type { + + /** DeviceEncryptionStatus enum. */ + enum DeviceEncryptionStatus { + ENCRYPTION_UNSPECIFIED = 0, + ENCRYPTION_UNSUPPORTED = 1, + UNENCRYPTED = 2, + ENCRYPTED = 3 + } + + /** OsType enum. */ + enum OsType { + OS_UNSPECIFIED = 0, + DESKTOP_MAC = 1, + DESKTOP_WINDOWS = 2, + DESKTOP_LINUX = 3, + DESKTOP_CHROME_OS = 6, + ANDROID = 4, + IOS = 5 + } + + /** DeviceManagementLevel enum. */ + enum DeviceManagementLevel { + MANAGEMENT_UNSPECIFIED = 0, + NONE = 1, + BASIC = 2, + COMPLETE = 3 + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.js b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.js new file mode 100644 index 00000000000..03c1574439b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.js @@ -0,0 +1,30150 @@ +// Copyright 2024 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots.asset_protos || ($protobuf.roots.asset_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.asset = (function() { + + /** + * Namespace asset. + * @memberof google.cloud + * @namespace + */ + var asset = {}; + + asset.v1p5beta1 = (function() { + + /** + * Namespace v1p5beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p5beta1 = {}; + + v1p5beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p5beta1 + * @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.v1p5beta1.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.v1p5beta1.AssetService|listAssets}. + * @memberof google.cloud.asset.v1p5beta1.AssetService + * @typedef ListAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.asset.v1p5beta1.ListAssetsResponse} [response] ListAssetsResponse + */ + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.asset.v1p5beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @param {google.cloud.asset.v1p5beta1.AssetService.ListAssetsCallback} callback Node-style callback called with the error, if any, and ListAssetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.listAssets = function listAssets(request, callback) { + return this.rpcCall(listAssets, $root.google.cloud.asset.v1p5beta1.ListAssetsRequest, $root.google.cloud.asset.v1p5beta1.ListAssetsResponse, request, callback); + }, "name", { value: "ListAssets" }); + + /** + * Calls ListAssets. + * @function listAssets + * @memberof google.cloud.asset.v1p5beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest} request ListAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p5beta1.ListAssetsRequest = (function() { + + /** + * Properties of a ListAssetsRequest. + * @memberof google.cloud.asset.v1p5beta1 + * @interface IListAssetsRequest + * @property {string|null} [parent] ListAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsRequest readTime + * @property {Array.|null} [assetTypes] ListAssetsRequest assetTypes + * @property {google.cloud.asset.v1p5beta1.ContentType|null} [contentType] ListAssetsRequest contentType + * @property {number|null} [pageSize] ListAssetsRequest pageSize + * @property {string|null} [pageToken] ListAssetsRequest pageToken + */ + + /** + * Constructs a new ListAssetsRequest. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents a ListAssetsRequest. + * @implements IListAssetsRequest + * @constructor + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest=} [properties] Properties to set + */ + function ListAssetsRequest(properties) { + this.assetTypes = []; + 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]]; + } + + /** + * ListAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.parent = ""; + + /** + * ListAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.readTime = null; + + /** + * ListAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ListAssetsRequest contentType. + * @member {google.cloud.asset.v1p5beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.contentType = 0; + + /** + * ListAssetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageSize = 0; + + /** + * ListAssetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p5beta1.ListAssetsRequest} ListAssetsRequest instance + */ + ListAssetsRequest.create = function create(properties) { + return new ListAssetsRequest(properties); + }; + + /** + * Encodes the specified ListAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsRequest} message ListAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p5beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.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.v1p5beta1.ListAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p5beta1.ListAssetsRequest} ListAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p5beta1.ListAssetsRequest} ListAssetsRequest + */ + ListAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p5beta1.ListAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1p5beta1.ListAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {google.cloud.asset.v1p5beta1.ListAssetsRequest} message ListAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assetTypes = []; + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p5beta1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1p5beta1.ContentType[message.contentType] : message.contentType; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p5beta1.ListAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p5beta1.ListAssetsRequest"; + }; + + return ListAssetsRequest; + })(); + + v1p5beta1.ListAssetsResponse = (function() { + + /** + * Properties of a ListAssetsResponse. + * @memberof google.cloud.asset.v1p5beta1 + * @interface IListAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ListAssetsResponse readTime + * @property {Array.|null} [assets] ListAssetsResponse assets + * @property {string|null} [nextPageToken] ListAssetsResponse nextPageToken + */ + + /** + * Constructs a new ListAssetsResponse. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents a ListAssetsResponse. + * @implements IListAssetsResponse + * @constructor + * @param {google.cloud.asset.v1p5beta1.IListAssetsResponse=} [properties] Properties to set + */ + function ListAssetsResponse(properties) { + this.assets = []; + 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]]; + } + + /** + * ListAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.readTime = null; + + /** + * ListAssetsResponse assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.assets = $util.emptyArray; + + /** + * ListAssetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @instance + */ + ListAssetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p5beta1.ListAssetsResponse} ListAssetsResponse instance + */ + ListAssetsResponse.create = function create(properties) { + return new ListAssetsResponse(properties); + }; + + /** + * Encodes the specified ListAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1p5beta1.Asset.encode(message.assets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.ListAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1p5beta1.IListAssetsResponse} message ListAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p5beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.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.v1p5beta1.ListAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1p5beta1.Asset.decode(reader, reader.uint32())); + break; + } + case 3: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p5beta1.ListAssetsResponse} ListAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1p5beta1.Asset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p5beta1.ListAssetsResponse} ListAssetsResponse + */ + ListAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p5beta1.ListAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1p5beta1.ListAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsResponse.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.ListAssetsResponse.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1p5beta1.Asset.fromObject(object.assets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {google.cloud.asset.v1p5beta1.ListAssetsResponse} message ListAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) { + object.readTime = null; + object.nextPageToken = ""; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1p5beta1.Asset.toObject(message.assets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p5beta1.ListAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p5beta1.ListAssetsResponse"; + }; + + return ListAssetsResponse; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1p5beta1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + */ + v1p5beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + return values; + })(); + + v1p5beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1p5beta1 + * @interface IAsset + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1p5beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1p5beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.orgPolicy = []; + this.ancestors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1p5beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {google.cloud.asset.v1p5beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p5beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p5beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {google.cloud.asset.v1p5beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1p5beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {google.cloud.asset.v1p5beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p5beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p5beta1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.asset.v1p5beta1.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + } + case 7: { + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + } + case 9: { + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p5beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1p5beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p5beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p5beta1.Asset) + return object; + var message = new $root.google.cloud.asset.v1p5beta1.Asset(); + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1p5beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p5beta1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {google.cloud.asset.v1p5beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.orgPolicy = []; + object.ancestors = []; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1p5beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p5beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.asset.v1p5beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p5beta1.Asset"; + }; + + return Asset; + })(); + + v1p5beta1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1p5beta1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1p5beta1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1p5beta1.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {google.cloud.asset.v1p5beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p5beta1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p5beta1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {google.cloud.asset.v1p5beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p5beta1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {google.cloud.asset.v1p5beta1.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.v1p5beta1.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.v1p5beta1.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.v1p5beta1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.discoveryDocumentUri = reader.string(); + break; + } + case 3: { + message.discoveryName = reader.string(); + break; + } + case 4: { + message.resourceUrl = reader.string(); + break; + } + case 5: { + message.parent = reader.string(); + break; + } + case 6: { + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Resource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p5beta1.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.v1p5beta1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p5beta1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p5beta1.Resource) + return object; + var message = new $root.google.cloud.asset.v1p5beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1p5beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {google.cloud.asset.v1p5beta1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p5beta1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1p5beta1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p5beta1.Resource"; + }; + + return Resource; + })(); + + return v1p5beta1; + })(); + + return asset; + })(); + + cloud.orgpolicy = (function() { + + /** + * Namespace orgpolicy. + * @memberof google.cloud + * @namespace + */ + var orgpolicy = {}; + + orgpolicy.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.orgpolicy + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.cloud.orgpolicy.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {string|null} [constraint] Policy constraint + * @property {Uint8Array|null} [etag] Policy etag + * @property {google.protobuf.ITimestamp|null} [updateTime] Policy updateTime + * @property {google.cloud.orgpolicy.v1.Policy.IListPolicy|null} [listPolicy] Policy listPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null} [booleanPolicy] Policy booleanPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null} [restoreDefault] Policy restoreDefault + */ + + /** + * Constructs a new Policy. + * @memberof google.cloud.orgpolicy.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + */ + function Policy(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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy constraint. + * @member {string} constraint + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.constraint = ""; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Policy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.updateTime = null; + + /** + * Policy listPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IListPolicy|null|undefined} listPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.listPolicy = null; + + /** + * Policy booleanPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null|undefined} booleanPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.booleanPolicy = null; + + /** + * Policy restoreDefault. + * @member {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null|undefined} restoreDefault + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.restoreDefault = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Policy policyType. + * @member {"listPolicy"|"booleanPolicy"|"restoreDefault"|undefined} policyType + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Object.defineProperty(Policy.prototype, "policyType", { + get: $util.oneOfGetter($oneOfFields = ["listPolicy", "booleanPolicy", "restoreDefault"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.listPolicy != null && Object.hasOwnProperty.call(message, "listPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.encode(message.listPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.booleanPolicy != null && Object.hasOwnProperty.call(message, "booleanPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.encode(message.booleanPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.restoreDefault != null && Object.hasOwnProperty.call(message, "restoreDefault")) + $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.encode(message.restoreDefault, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.orgpolicy.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + message.constraint = reader.string(); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.decode(reader, reader.uint32()); + break; + } + case 6: { + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.decode(reader, reader.uint32()); + break; + } + case 7: { + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isString(message.constraint)) + return "constraint: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.verify(message.listPolicy); + if (error) + return "listPolicy." + error; + } + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify(message.booleanPolicy); + if (error) + return "booleanPolicy." + error; + } + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify(message.restoreDefault); + if (error) + return "restoreDefault." + error; + } + } + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.constraint != null) + message.constraint = String(object.constraint); + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.listPolicy != null) { + if (typeof object.listPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.listPolicy: object expected"); + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.fromObject(object.listPolicy); + } + if (object.booleanPolicy != null) { + if (typeof object.booleanPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.booleanPolicy: object expected"); + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.fromObject(object.booleanPolicy); + } + if (object.restoreDefault != null) { + if (typeof object.restoreDefault !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.restoreDefault: object expected"); + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.fromObject(object.restoreDefault); + } + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = 0; + object.constraint = ""; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + object.updateTime = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + object.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.toObject(message.listPolicy, options); + if (options.oneofs) + object.policyType = "listPolicy"; + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + object.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.toObject(message.booleanPolicy, options); + if (options.oneofs) + object.policyType = "booleanPolicy"; + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + object.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.toObject(message.restoreDefault, options); + if (options.oneofs) + object.policyType = "restoreDefault"; + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy"; + }; + + Policy.ListPolicy = (function() { + + /** + * Properties of a ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IListPolicy + * @property {Array.|null} [allowedValues] ListPolicy allowedValues + * @property {Array.|null} [deniedValues] ListPolicy deniedValues + * @property {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null} [allValues] ListPolicy allValues + * @property {string|null} [suggestedValue] ListPolicy suggestedValue + * @property {boolean|null} [inheritFromParent] ListPolicy inheritFromParent + */ + + /** + * Constructs a new ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a ListPolicy. + * @implements IListPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + */ + function ListPolicy(properties) { + this.allowedValues = []; + this.deniedValues = []; + 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]]; + } + + /** + * ListPolicy allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allowedValues = $util.emptyArray; + + /** + * ListPolicy deniedValues. + * @member {Array.} deniedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.deniedValues = $util.emptyArray; + + /** + * ListPolicy allValues. + * @member {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues} allValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allValues = 0; + + /** + * ListPolicy suggestedValue. + * @member {string} suggestedValue + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.suggestedValue = ""; + + /** + * ListPolicy inheritFromParent. + * @member {boolean} inheritFromParent + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.inheritFromParent = false; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy instance + */ + ListPolicy.create = function create(properties) { + return new ListPolicy(properties); + }; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + if (message.deniedValues != null && message.deniedValues.length) + for (var i = 0; i < message.deniedValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedValues[i]); + if (message.allValues != null && Object.hasOwnProperty.call(message, "allValues")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.allValues); + if (message.suggestedValue != null && Object.hasOwnProperty.call(message, "suggestedValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.suggestedValue); + if (message.inheritFromParent != null && Object.hasOwnProperty.call(message, "inheritFromParent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inheritFromParent); + return writer; + }; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.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.orgpolicy.v1.Policy.ListPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + case 2: { + if (!(message.deniedValues && message.deniedValues.length)) + message.deniedValues = []; + message.deniedValues.push(reader.string()); + break; + } + case 3: { + message.allValues = reader.int32(); + break; + } + case 4: { + message.suggestedValue = reader.string(); + break; + } + case 5: { + message.inheritFromParent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + if (message.deniedValues != null && message.hasOwnProperty("deniedValues")) { + if (!Array.isArray(message.deniedValues)) + return "deniedValues: array expected"; + for (var i = 0; i < message.deniedValues.length; ++i) + if (!$util.isString(message.deniedValues[i])) + return "deniedValues: string[] expected"; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + switch (message.allValues) { + default: + return "allValues: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + if (!$util.isString(message.suggestedValue)) + return "suggestedValue: string expected"; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + if (typeof message.inheritFromParent !== "boolean") + return "inheritFromParent: boolean expected"; + return null; + }; + + /** + * Creates a ListPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + */ + ListPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.ListPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.ListPolicy(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + if (object.deniedValues) { + if (!Array.isArray(object.deniedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.deniedValues: array expected"); + message.deniedValues = []; + for (var i = 0; i < object.deniedValues.length; ++i) + message.deniedValues[i] = String(object.deniedValues[i]); + } + switch (object.allValues) { + default: + if (typeof object.allValues === "number") { + message.allValues = object.allValues; + break; + } + break; + case "ALL_VALUES_UNSPECIFIED": + case 0: + message.allValues = 0; + break; + case "ALLOW": + case 1: + message.allValues = 1; + break; + case "DENY": + case 2: + message.allValues = 2; + break; + } + if (object.suggestedValue != null) + message.suggestedValue = String(object.suggestedValue); + if (object.inheritFromParent != null) + message.inheritFromParent = Boolean(object.inheritFromParent); + return message; + }; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.ListPolicy} message ListPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedValues = []; + object.deniedValues = []; + } + if (options.defaults) { + object.allValues = options.enums === String ? "ALL_VALUES_UNSPECIFIED" : 0; + object.suggestedValue = ""; + object.inheritFromParent = false; + } + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + if (message.deniedValues && message.deniedValues.length) { + object.deniedValues = []; + for (var j = 0; j < message.deniedValues.length; ++j) + object.deniedValues[j] = message.deniedValues[j]; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + object.allValues = options.enums === String ? $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] === undefined ? message.allValues : $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] : message.allValues; + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + object.suggestedValue = message.suggestedValue; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + object.inheritFromParent = message.inheritFromParent; + return object; + }; + + /** + * Converts this ListPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + * @returns {Object.} JSON object + */ + ListPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.ListPolicy"; + }; + + /** + * AllValues enum. + * @name google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues + * @enum {number} + * @property {number} ALL_VALUES_UNSPECIFIED=0 ALL_VALUES_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + ListPolicy.AllValues = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALL_VALUES_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return ListPolicy; + })(); + + Policy.BooleanPolicy = (function() { + + /** + * Properties of a BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IBooleanPolicy + * @property {boolean|null} [enforced] BooleanPolicy enforced + */ + + /** + * Constructs a new BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a BooleanPolicy. + * @implements IBooleanPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + */ + function BooleanPolicy(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]]; + } + + /** + * BooleanPolicy enforced. + * @member {boolean} enforced + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + */ + BooleanPolicy.prototype.enforced = false; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy instance + */ + BooleanPolicy.create = function create(properties) { + return new BooleanPolicy(properties); + }; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enforced != null && Object.hasOwnProperty.call(message, "enforced")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enforced); + return writer; + }; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.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.orgpolicy.v1.Policy.BooleanPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enforced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BooleanPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BooleanPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforced != null && message.hasOwnProperty("enforced")) + if (typeof message.enforced !== "boolean") + return "enforced: boolean expected"; + return null; + }; + + /** + * Creates a BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + */ + BooleanPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy(); + if (object.enforced != null) + message.enforced = Boolean(object.enforced); + return message; + }; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} message BooleanPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BooleanPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enforced = false; + if (message.enforced != null && message.hasOwnProperty("enforced")) + object.enforced = message.enforced; + return object; + }; + + /** + * Converts this BooleanPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + * @returns {Object.} JSON object + */ + BooleanPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BooleanPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BooleanPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.BooleanPolicy"; + }; + + return BooleanPolicy; + })(); + + Policy.RestoreDefault = (function() { + + /** + * Properties of a RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IRestoreDefault + */ + + /** + * Constructs a new RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a RestoreDefault. + * @implements IRestoreDefault + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + */ + function RestoreDefault(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]]; + } + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault instance + */ + RestoreDefault.create = function create(properties) { + return new RestoreDefault(properties); + }; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.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.orgpolicy.v1.Policy.RestoreDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDefault message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + */ + RestoreDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault) + return object; + return new $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault(); + }; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.RestoreDefault} message RestoreDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDefault.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestoreDefault to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @instance + * @returns {Object.} JSON object + */ + RestoreDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDefault + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.RestoreDefault"; + }; + + return RestoreDefault; + })(); + + return Policy; + })(); + + return v1; + })(); + + return orgpolicy; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + 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]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + 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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + 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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + 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]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.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.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + 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]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + 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]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + 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]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + return protobuf; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + 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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + 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]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.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.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.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.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + 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]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.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.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.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.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.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.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.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.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.identity = (function() { + + /** + * Namespace identity. + * @memberof google + * @namespace + */ + var identity = {}; + + identity.accesscontextmanager = (function() { + + /** + * Namespace accesscontextmanager. + * @memberof google.identity + * @namespace + */ + var accesscontextmanager = {}; + + accesscontextmanager.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var v1 = {}; + + v1.AccessLevel = (function() { + + /** + * Properties of an AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessLevel + * @property {string|null} [name] AccessLevel name + * @property {string|null} [title] AccessLevel title + * @property {string|null} [description] AccessLevel description + * @property {google.identity.accesscontextmanager.v1.IBasicLevel|null} [basic] AccessLevel basic + * @property {google.identity.accesscontextmanager.v1.ICustomLevel|null} [custom] AccessLevel custom + * @property {google.protobuf.ITimestamp|null} [createTime] AccessLevel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessLevel updateTime + */ + + /** + * Constructs a new AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessLevel. + * @implements IAccessLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + */ + function AccessLevel(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]]; + } + + /** + * AccessLevel name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.name = ""; + + /** + * AccessLevel title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.title = ""; + + /** + * AccessLevel description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.description = ""; + + /** + * AccessLevel basic. + * @member {google.identity.accesscontextmanager.v1.IBasicLevel|null|undefined} basic + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.basic = null; + + /** + * AccessLevel custom. + * @member {google.identity.accesscontextmanager.v1.ICustomLevel|null|undefined} custom + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.custom = null; + + /** + * AccessLevel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.createTime = null; + + /** + * AccessLevel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessLevel level. + * @member {"basic"|"custom"|undefined} level + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + Object.defineProperty(AccessLevel.prototype, "level", { + get: $util.oneOfGetter($oneOfFields = ["basic", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel instance + */ + AccessLevel.create = function create(properties) { + return new AccessLevel(properties); + }; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.basic != null && Object.hasOwnProperty.call(message, "basic")) + $root.google.identity.accesscontextmanager.v1.BasicLevel.encode(message.basic, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.identity.accesscontextmanager.v1.CustomLevel.encode(message.custom, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.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.identity.accesscontextmanager.v1.AccessLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.decode(reader, reader.uint32()); + break; + } + case 5: { + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.basic != null && message.hasOwnProperty("basic")) { + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.BasicLevel.verify(message.basic); + if (error) + return "basic." + error; + } + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.level === 1) + return "level: multiple values"; + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.CustomLevel.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an AccessLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + */ + AccessLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessLevel(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.basic != null) { + if (typeof object.basic !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.basic: object expected"); + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.fromObject(object.basic); + } + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.custom: object expected"); + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.fromObject(object.custom); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.AccessLevel} message AccessLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.basic != null && message.hasOwnProperty("basic")) { + object.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.toObject(message.basic, options); + if (options.oneofs) + object.level = "basic"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.toObject(message.custom, options); + if (options.oneofs) + object.level = "custom"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this AccessLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + * @returns {Object.} JSON object + */ + AccessLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessLevel"; + }; + + return AccessLevel; + })(); + + v1.BasicLevel = (function() { + + /** + * Properties of a BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IBasicLevel + * @property {Array.|null} [conditions] BasicLevel conditions + * @property {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null} [combiningFunction] BasicLevel combiningFunction + */ + + /** + * Constructs a new BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a BasicLevel. + * @implements IBasicLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + */ + function BasicLevel(properties) { + this.conditions = []; + 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]]; + } + + /** + * BasicLevel conditions. + * @member {Array.} conditions + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.conditions = $util.emptyArray; + + /** + * BasicLevel combiningFunction. + * @member {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction} combiningFunction + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.combiningFunction = 0; + + /** + * Creates a new BasicLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel instance + */ + BasicLevel.create = function create(properties) { + return new BasicLevel(properties); + }; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.identity.accesscontextmanager.v1.Condition.encode(message.conditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.combiningFunction != null && Object.hasOwnProperty.call(message, "combiningFunction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.combiningFunction); + return writer; + }; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.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.identity.accesscontextmanager.v1.BasicLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.identity.accesscontextmanager.v1.Condition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.combiningFunction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + switch (message.combiningFunction) { + default: + return "combiningFunction: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a BasicLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + */ + BasicLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.BasicLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.BasicLevel(); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: object expected"); + message.conditions[i] = $root.google.identity.accesscontextmanager.v1.Condition.fromObject(object.conditions[i]); + } + } + switch (object.combiningFunction) { + default: + if (typeof object.combiningFunction === "number") { + message.combiningFunction = object.combiningFunction; + break; + } + break; + case "AND": + case 0: + message.combiningFunction = 0; + break; + case "OR": + case 1: + message.combiningFunction = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.BasicLevel} message BasicLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (options.defaults) + object.combiningFunction = options.enums === String ? "AND" : 0; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.identity.accesscontextmanager.v1.Condition.toObject(message.conditions[j], options); + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + object.combiningFunction = options.enums === String ? $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] === undefined ? message.combiningFunction : $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] : message.combiningFunction; + return object; + }; + + /** + * Converts this BasicLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + * @returns {Object.} JSON object + */ + BasicLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BasicLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BasicLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.BasicLevel"; + }; + + /** + * ConditionCombiningFunction enum. + * @name google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + * @enum {number} + * @property {number} AND=0 AND value + * @property {number} OR=1 OR value + */ + BasicLevel.ConditionCombiningFunction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AND"] = 0; + values[valuesById[1] = "OR"] = 1; + return values; + })(); + + return BasicLevel; + })(); + + v1.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICondition + * @property {Array.|null} [ipSubnetworks] Condition ipSubnetworks + * @property {google.identity.accesscontextmanager.v1.IDevicePolicy|null} [devicePolicy] Condition devicePolicy + * @property {Array.|null} [requiredAccessLevels] Condition requiredAccessLevels + * @property {boolean|null} [negate] Condition negate + * @property {Array.|null} [members] Condition members + * @property {Array.|null} [regions] Condition regions + */ + + /** + * Constructs a new Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + this.ipSubnetworks = []; + this.requiredAccessLevels = []; + this.members = []; + this.regions = []; + 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]]; + } + + /** + * Condition ipSubnetworks. + * @member {Array.} ipSubnetworks + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.ipSubnetworks = $util.emptyArray; + + /** + * Condition devicePolicy. + * @member {google.identity.accesscontextmanager.v1.IDevicePolicy|null|undefined} devicePolicy + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.devicePolicy = null; + + /** + * Condition requiredAccessLevels. + * @member {Array.} requiredAccessLevels + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.requiredAccessLevels = $util.emptyArray; + + /** + * Condition negate. + * @member {boolean} negate + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.negate = false; + + /** + * Condition members. + * @member {Array.} members + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.members = $util.emptyArray; + + /** + * Condition regions. + * @member {Array.} regions + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.regions = $util.emptyArray; + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipSubnetworks != null && message.ipSubnetworks.length) + for (var i = 0; i < message.ipSubnetworks.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipSubnetworks[i]); + if (message.devicePolicy != null && Object.hasOwnProperty.call(message, "devicePolicy")) + $root.google.identity.accesscontextmanager.v1.DevicePolicy.encode(message.devicePolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requiredAccessLevels != null && message.requiredAccessLevels.length) + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requiredAccessLevels[i]); + if (message.negate != null && Object.hasOwnProperty.call(message, "negate")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.negate); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.members[i]); + if (message.regions != null && message.regions.length) + for (var i = 0; i < message.regions.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.regions[i]); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.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.identity.accesscontextmanager.v1.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ipSubnetworks && message.ipSubnetworks.length)) + message.ipSubnetworks = []; + message.ipSubnetworks.push(reader.string()); + break; + } + case 2: { + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.requiredAccessLevels && message.requiredAccessLevels.length)) + message.requiredAccessLevels = []; + message.requiredAccessLevels.push(reader.string()); + break; + } + case 5: { + message.negate = reader.bool(); + break; + } + case 6: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 7: { + if (!(message.regions && message.regions.length)) + message.regions = []; + message.regions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipSubnetworks != null && message.hasOwnProperty("ipSubnetworks")) { + if (!Array.isArray(message.ipSubnetworks)) + return "ipSubnetworks: array expected"; + for (var i = 0; i < message.ipSubnetworks.length; ++i) + if (!$util.isString(message.ipSubnetworks[i])) + return "ipSubnetworks: string[] expected"; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) { + var error = $root.google.identity.accesscontextmanager.v1.DevicePolicy.verify(message.devicePolicy); + if (error) + return "devicePolicy." + error; + } + if (message.requiredAccessLevels != null && message.hasOwnProperty("requiredAccessLevels")) { + if (!Array.isArray(message.requiredAccessLevels)) + return "requiredAccessLevels: array expected"; + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + if (!$util.isString(message.requiredAccessLevels[i])) + return "requiredAccessLevels: string[] expected"; + } + if (message.negate != null && message.hasOwnProperty("negate")) + if (typeof message.negate !== "boolean") + return "negate: boolean expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.regions != null && message.hasOwnProperty("regions")) { + if (!Array.isArray(message.regions)) + return "regions: array expected"; + for (var i = 0; i < message.regions.length; ++i) + if (!$util.isString(message.regions[i])) + return "regions: string[] expected"; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.Condition) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.Condition(); + if (object.ipSubnetworks) { + if (!Array.isArray(object.ipSubnetworks)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.ipSubnetworks: array expected"); + message.ipSubnetworks = []; + for (var i = 0; i < object.ipSubnetworks.length; ++i) + message.ipSubnetworks[i] = String(object.ipSubnetworks[i]); + } + if (object.devicePolicy != null) { + if (typeof object.devicePolicy !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.devicePolicy: object expected"); + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.fromObject(object.devicePolicy); + } + if (object.requiredAccessLevels) { + if (!Array.isArray(object.requiredAccessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.requiredAccessLevels: array expected"); + message.requiredAccessLevels = []; + for (var i = 0; i < object.requiredAccessLevels.length; ++i) + message.requiredAccessLevels[i] = String(object.requiredAccessLevels[i]); + } + if (object.negate != null) + message.negate = Boolean(object.negate); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.regions) { + if (!Array.isArray(object.regions)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.regions: array expected"); + message.regions = []; + for (var i = 0; i < object.regions.length; ++i) + message.regions[i] = String(object.regions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipSubnetworks = []; + object.requiredAccessLevels = []; + object.members = []; + object.regions = []; + } + if (options.defaults) { + object.devicePolicy = null; + object.negate = false; + } + if (message.ipSubnetworks && message.ipSubnetworks.length) { + object.ipSubnetworks = []; + for (var j = 0; j < message.ipSubnetworks.length; ++j) + object.ipSubnetworks[j] = message.ipSubnetworks[j]; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) + object.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.toObject(message.devicePolicy, options); + if (message.requiredAccessLevels && message.requiredAccessLevels.length) { + object.requiredAccessLevels = []; + for (var j = 0; j < message.requiredAccessLevels.length; ++j) + object.requiredAccessLevels[j] = message.requiredAccessLevels[j]; + } + if (message.negate != null && message.hasOwnProperty("negate")) + object.negate = message.negate; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.regions && message.regions.length) { + object.regions = []; + for (var j = 0; j < message.regions.length; ++j) + object.regions[j] = message.regions[j]; + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.Condition"; + }; + + return Condition; + })(); + + v1.CustomLevel = (function() { + + /** + * Properties of a CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICustomLevel + * @property {google.type.IExpr|null} [expr] CustomLevel expr + */ + + /** + * Constructs a new CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a CustomLevel. + * @implements ICustomLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + */ + function CustomLevel(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]]; + } + + /** + * CustomLevel expr. + * @member {google.type.IExpr|null|undefined} expr + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + */ + CustomLevel.prototype.expr = null; + + /** + * Creates a new CustomLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel instance + */ + CustomLevel.create = function create(properties) { + return new CustomLevel(properties); + }; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.google.type.Expr.encode(message.expr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.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.identity.accesscontextmanager.v1.CustomLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expr = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.google.type.Expr.verify(message.expr); + if (error) + return "expr." + error; + } + return null; + }; + + /** + * Creates a CustomLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + */ + CustomLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.CustomLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.CustomLevel(); + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.CustomLevel.expr: object expected"); + message.expr = $root.google.type.Expr.fromObject(object.expr); + } + return message; + }; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.CustomLevel} message CustomLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expr = null; + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.google.type.Expr.toObject(message.expr, options); + return object; + }; + + /** + * Converts this CustomLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + * @returns {Object.} JSON object + */ + CustomLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.CustomLevel"; + }; + + return CustomLevel; + })(); + + v1.DevicePolicy = (function() { + + /** + * Properties of a DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IDevicePolicy + * @property {boolean|null} [requireScreenlock] DevicePolicy requireScreenlock + * @property {Array.|null} [allowedEncryptionStatuses] DevicePolicy allowedEncryptionStatuses + * @property {Array.|null} [osConstraints] DevicePolicy osConstraints + * @property {Array.|null} [allowedDeviceManagementLevels] DevicePolicy allowedDeviceManagementLevels + * @property {boolean|null} [requireAdminApproval] DevicePolicy requireAdminApproval + * @property {boolean|null} [requireCorpOwned] DevicePolicy requireCorpOwned + */ + + /** + * Constructs a new DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a DevicePolicy. + * @implements IDevicePolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + */ + function DevicePolicy(properties) { + this.allowedEncryptionStatuses = []; + this.osConstraints = []; + this.allowedDeviceManagementLevels = []; + 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]]; + } + + /** + * DevicePolicy requireScreenlock. + * @member {boolean} requireScreenlock + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireScreenlock = false; + + /** + * DevicePolicy allowedEncryptionStatuses. + * @member {Array.} allowedEncryptionStatuses + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedEncryptionStatuses = $util.emptyArray; + + /** + * DevicePolicy osConstraints. + * @member {Array.} osConstraints + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.osConstraints = $util.emptyArray; + + /** + * DevicePolicy allowedDeviceManagementLevels. + * @member {Array.} allowedDeviceManagementLevels + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedDeviceManagementLevels = $util.emptyArray; + + /** + * DevicePolicy requireAdminApproval. + * @member {boolean} requireAdminApproval + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireAdminApproval = false; + + /** + * DevicePolicy requireCorpOwned. + * @member {boolean} requireCorpOwned + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireCorpOwned = false; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy instance + */ + DevicePolicy.create = function create(properties) { + return new DevicePolicy(properties); + }; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireScreenlock != null && Object.hasOwnProperty.call(message, "requireScreenlock")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireScreenlock); + if (message.allowedEncryptionStatuses != null && message.allowedEncryptionStatuses.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + writer.int32(message.allowedEncryptionStatuses[i]); + writer.ldelim(); + } + if (message.osConstraints != null && message.osConstraints.length) + for (var i = 0; i < message.osConstraints.length; ++i) + $root.google.identity.accesscontextmanager.v1.OsConstraint.encode(message.osConstraints[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowedDeviceManagementLevels != null && message.allowedDeviceManagementLevels.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + writer.int32(message.allowedDeviceManagementLevels[i]); + writer.ldelim(); + } + if (message.requireAdminApproval != null && Object.hasOwnProperty.call(message, "requireAdminApproval")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requireAdminApproval); + if (message.requireCorpOwned != null && Object.hasOwnProperty.call(message, "requireCorpOwned")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.requireCorpOwned); + return writer; + }; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.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.identity.accesscontextmanager.v1.DevicePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requireScreenlock = reader.bool(); + break; + } + case 2: { + if (!(message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length)) + message.allowedEncryptionStatuses = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedEncryptionStatuses.push(reader.int32()); + } else + message.allowedEncryptionStatuses.push(reader.int32()); + break; + } + case 3: { + if (!(message.osConstraints && message.osConstraints.length)) + message.osConstraints = []; + message.osConstraints.push($root.google.identity.accesscontextmanager.v1.OsConstraint.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length)) + message.allowedDeviceManagementLevels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedDeviceManagementLevels.push(reader.int32()); + } else + message.allowedDeviceManagementLevels.push(reader.int32()); + break; + } + case 7: { + message.requireAdminApproval = reader.bool(); + break; + } + case 8: { + message.requireCorpOwned = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DevicePolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DevicePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + if (typeof message.requireScreenlock !== "boolean") + return "requireScreenlock: boolean expected"; + if (message.allowedEncryptionStatuses != null && message.hasOwnProperty("allowedEncryptionStatuses")) { + if (!Array.isArray(message.allowedEncryptionStatuses)) + return "allowedEncryptionStatuses: array expected"; + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + switch (message.allowedEncryptionStatuses[i]) { + default: + return "allowedEncryptionStatuses: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.osConstraints != null && message.hasOwnProperty("osConstraints")) { + if (!Array.isArray(message.osConstraints)) + return "osConstraints: array expected"; + for (var i = 0; i < message.osConstraints.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.OsConstraint.verify(message.osConstraints[i]); + if (error) + return "osConstraints." + error; + } + } + if (message.allowedDeviceManagementLevels != null && message.hasOwnProperty("allowedDeviceManagementLevels")) { + if (!Array.isArray(message.allowedDeviceManagementLevels)) + return "allowedDeviceManagementLevels: array expected"; + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + switch (message.allowedDeviceManagementLevels[i]) { + default: + return "allowedDeviceManagementLevels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + if (typeof message.requireAdminApproval !== "boolean") + return "requireAdminApproval: boolean expected"; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + if (typeof message.requireCorpOwned !== "boolean") + return "requireCorpOwned: boolean expected"; + return null; + }; + + /** + * Creates a DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + */ + DevicePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.DevicePolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.DevicePolicy(); + if (object.requireScreenlock != null) + message.requireScreenlock = Boolean(object.requireScreenlock); + if (object.allowedEncryptionStatuses) { + if (!Array.isArray(object.allowedEncryptionStatuses)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedEncryptionStatuses: array expected"); + message.allowedEncryptionStatuses = []; + for (var i = 0; i < object.allowedEncryptionStatuses.length; ++i) + switch (object.allowedEncryptionStatuses[i]) { + default: + if (typeof object.allowedEncryptionStatuses[i] === "number") { + message.allowedEncryptionStatuses[i] = object.allowedEncryptionStatuses[i]; + break; + } + case "ENCRYPTION_UNSPECIFIED": + case 0: + message.allowedEncryptionStatuses[i] = 0; + break; + case "ENCRYPTION_UNSUPPORTED": + case 1: + message.allowedEncryptionStatuses[i] = 1; + break; + case "UNENCRYPTED": + case 2: + message.allowedEncryptionStatuses[i] = 2; + break; + case "ENCRYPTED": + case 3: + message.allowedEncryptionStatuses[i] = 3; + break; + } + } + if (object.osConstraints) { + if (!Array.isArray(object.osConstraints)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: array expected"); + message.osConstraints = []; + for (var i = 0; i < object.osConstraints.length; ++i) { + if (typeof object.osConstraints[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: object expected"); + message.osConstraints[i] = $root.google.identity.accesscontextmanager.v1.OsConstraint.fromObject(object.osConstraints[i]); + } + } + if (object.allowedDeviceManagementLevels) { + if (!Array.isArray(object.allowedDeviceManagementLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedDeviceManagementLevels: array expected"); + message.allowedDeviceManagementLevels = []; + for (var i = 0; i < object.allowedDeviceManagementLevels.length; ++i) + switch (object.allowedDeviceManagementLevels[i]) { + default: + if (typeof object.allowedDeviceManagementLevels[i] === "number") { + message.allowedDeviceManagementLevels[i] = object.allowedDeviceManagementLevels[i]; + break; + } + case "MANAGEMENT_UNSPECIFIED": + case 0: + message.allowedDeviceManagementLevels[i] = 0; + break; + case "NONE": + case 1: + message.allowedDeviceManagementLevels[i] = 1; + break; + case "BASIC": + case 2: + message.allowedDeviceManagementLevels[i] = 2; + break; + case "COMPLETE": + case 3: + message.allowedDeviceManagementLevels[i] = 3; + break; + } + } + if (object.requireAdminApproval != null) + message.requireAdminApproval = Boolean(object.requireAdminApproval); + if (object.requireCorpOwned != null) + message.requireCorpOwned = Boolean(object.requireCorpOwned); + return message; + }; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.DevicePolicy} message DevicePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DevicePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedEncryptionStatuses = []; + object.osConstraints = []; + object.allowedDeviceManagementLevels = []; + } + if (options.defaults) { + object.requireScreenlock = false; + object.requireAdminApproval = false; + object.requireCorpOwned = false; + } + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + object.requireScreenlock = message.requireScreenlock; + if (message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length) { + object.allowedEncryptionStatuses = []; + for (var j = 0; j < message.allowedEncryptionStatuses.length; ++j) + object.allowedEncryptionStatuses[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] === undefined ? message.allowedEncryptionStatuses[j] : $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] : message.allowedEncryptionStatuses[j]; + } + if (message.osConstraints && message.osConstraints.length) { + object.osConstraints = []; + for (var j = 0; j < message.osConstraints.length; ++j) + object.osConstraints[j] = $root.google.identity.accesscontextmanager.v1.OsConstraint.toObject(message.osConstraints[j], options); + } + if (message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length) { + object.allowedDeviceManagementLevels = []; + for (var j = 0; j < message.allowedDeviceManagementLevels.length; ++j) + object.allowedDeviceManagementLevels[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] === undefined ? message.allowedDeviceManagementLevels[j] : $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] : message.allowedDeviceManagementLevels[j]; + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + object.requireAdminApproval = message.requireAdminApproval; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + object.requireCorpOwned = message.requireCorpOwned; + return object; + }; + + /** + * Converts this DevicePolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + * @returns {Object.} JSON object + */ + DevicePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DevicePolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DevicePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.DevicePolicy"; + }; + + return DevicePolicy; + })(); + + v1.OsConstraint = (function() { + + /** + * Properties of an OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IOsConstraint + * @property {google.identity.accesscontextmanager.type.OsType|null} [osType] OsConstraint osType + * @property {string|null} [minimumVersion] OsConstraint minimumVersion + * @property {boolean|null} [requireVerifiedChromeOs] OsConstraint requireVerifiedChromeOs + */ + + /** + * Constructs a new OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an OsConstraint. + * @implements IOsConstraint + * @constructor + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + */ + function OsConstraint(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]]; + } + + /** + * OsConstraint osType. + * @member {google.identity.accesscontextmanager.type.OsType} osType + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.osType = 0; + + /** + * OsConstraint minimumVersion. + * @member {string} minimumVersion + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.minimumVersion = ""; + + /** + * OsConstraint requireVerifiedChromeOs. + * @member {boolean} requireVerifiedChromeOs + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.requireVerifiedChromeOs = false; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint instance + */ + OsConstraint.create = function create(properties) { + return new OsConstraint(properties); + }; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osType != null && Object.hasOwnProperty.call(message, "osType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.osType); + if (message.minimumVersion != null && Object.hasOwnProperty.call(message, "minimumVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.minimumVersion); + if (message.requireVerifiedChromeOs != null && Object.hasOwnProperty.call(message, "requireVerifiedChromeOs")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requireVerifiedChromeOs); + return writer; + }; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.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.identity.accesscontextmanager.v1.OsConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osType = reader.int32(); + break; + } + case 2: { + message.minimumVersion = reader.string(); + break; + } + case 3: { + message.requireVerifiedChromeOs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsConstraint message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osType != null && message.hasOwnProperty("osType")) + switch (message.osType) { + default: + return "osType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + case 4: + case 5: + break; + } + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + if (!$util.isString(message.minimumVersion)) + return "minimumVersion: string expected"; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + if (typeof message.requireVerifiedChromeOs !== "boolean") + return "requireVerifiedChromeOs: boolean expected"; + return null; + }; + + /** + * Creates an OsConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + */ + OsConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.OsConstraint) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.OsConstraint(); + switch (object.osType) { + default: + if (typeof object.osType === "number") { + message.osType = object.osType; + break; + } + break; + case "OS_UNSPECIFIED": + case 0: + message.osType = 0; + break; + case "DESKTOP_MAC": + case 1: + message.osType = 1; + break; + case "DESKTOP_WINDOWS": + case 2: + message.osType = 2; + break; + case "DESKTOP_LINUX": + case 3: + message.osType = 3; + break; + case "DESKTOP_CHROME_OS": + case 6: + message.osType = 6; + break; + case "ANDROID": + case 4: + message.osType = 4; + break; + case "IOS": + case 5: + message.osType = 5; + break; + } + if (object.minimumVersion != null) + message.minimumVersion = String(object.minimumVersion); + if (object.requireVerifiedChromeOs != null) + message.requireVerifiedChromeOs = Boolean(object.requireVerifiedChromeOs); + return message; + }; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.OsConstraint} message OsConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osType = options.enums === String ? "OS_UNSPECIFIED" : 0; + object.minimumVersion = ""; + object.requireVerifiedChromeOs = false; + } + if (message.osType != null && message.hasOwnProperty("osType")) + object.osType = options.enums === String ? $root.google.identity.accesscontextmanager.type.OsType[message.osType] === undefined ? message.osType : $root.google.identity.accesscontextmanager.type.OsType[message.osType] : message.osType; + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + object.minimumVersion = message.minimumVersion; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + object.requireVerifiedChromeOs = message.requireVerifiedChromeOs; + return object; + }; + + /** + * Converts this OsConstraint to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + * @returns {Object.} JSON object + */ + OsConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OsConstraint + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.OsConstraint"; + }; + + return OsConstraint; + })(); + + v1.AccessPolicy = (function() { + + /** + * Properties of an AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessPolicy + * @property {string|null} [name] AccessPolicy name + * @property {string|null} [parent] AccessPolicy parent + * @property {string|null} [title] AccessPolicy title + * @property {Array.|null} [scopes] AccessPolicy scopes + * @property {google.protobuf.ITimestamp|null} [createTime] AccessPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessPolicy updateTime + * @property {string|null} [etag] AccessPolicy etag + */ + + /** + * Constructs a new AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessPolicy. + * @implements IAccessPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + */ + function AccessPolicy(properties) { + this.scopes = []; + 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]]; + } + + /** + * AccessPolicy name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.name = ""; + + /** + * AccessPolicy parent. + * @member {string} parent + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.parent = ""; + + /** + * AccessPolicy title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.title = ""; + + /** + * AccessPolicy scopes. + * @member {Array.} scopes + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.scopes = $util.emptyArray; + + /** + * AccessPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.createTime = null; + + /** + * AccessPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.updateTime = null; + + /** + * AccessPolicy etag. + * @member {string} etag + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.etag = ""; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy instance + */ + AccessPolicy.create = function create(properties) { + return new AccessPolicy(properties); + }; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.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.identity.accesscontextmanager.v1.AccessPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.title = reader.string(); + break; + } + case 7: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + */ + AccessPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.title != null) + message.title = String(object.title); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.AccessPolicy} message AccessPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.title = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this AccessPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + * @returns {Object.} JSON object + */ + AccessPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessPolicy"; + }; + + return AccessPolicy; + })(); + + v1.ServicePerimeter = (function() { + + /** + * Properties of a ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeter + * @property {string|null} [name] ServicePerimeter name + * @property {string|null} [title] ServicePerimeter title + * @property {string|null} [description] ServicePerimeter description + * @property {google.protobuf.ITimestamp|null} [createTime] ServicePerimeter createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ServicePerimeter updateTime + * @property {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null} [perimeterType] ServicePerimeter perimeterType + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [status] ServicePerimeter status + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [spec] ServicePerimeter spec + * @property {boolean|null} [useExplicitDryRunSpec] ServicePerimeter useExplicitDryRunSpec + */ + + /** + * Constructs a new ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeter. + * @implements IServicePerimeter + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + */ + function ServicePerimeter(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]]; + } + + /** + * ServicePerimeter name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.name = ""; + + /** + * ServicePerimeter title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.title = ""; + + /** + * ServicePerimeter description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.description = ""; + + /** + * ServicePerimeter createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.createTime = null; + + /** + * ServicePerimeter updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.updateTime = null; + + /** + * ServicePerimeter perimeterType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType} perimeterType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.perimeterType = 0; + + /** + * ServicePerimeter status. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} status + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.status = null; + + /** + * ServicePerimeter spec. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} spec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.spec = null; + + /** + * ServicePerimeter useExplicitDryRunSpec. + * @member {boolean} useExplicitDryRunSpec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.useExplicitDryRunSpec = false; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter instance + */ + ServicePerimeter.create = function create(properties) { + return new ServicePerimeter(properties); + }; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.perimeterType != null && Object.hasOwnProperty.call(message, "perimeterType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.perimeterType); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.spec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.useExplicitDryRunSpec != null && Object.hasOwnProperty.call(message, "useExplicitDryRunSpec")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.useExplicitDryRunSpec); + return writer; + }; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.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.identity.accesscontextmanager.v1.ServicePerimeter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.perimeterType = reader.int32(); + break; + } + case 7: { + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.useExplicitDryRunSpec = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServicePerimeter message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeter.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.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + switch (message.perimeterType) { + default: + return "perimeterType: enum value expected"; + case 0: + case 1: + break; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.status); + if (error) + return "status." + error; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + if (typeof message.useExplicitDryRunSpec !== "boolean") + return "useExplicitDryRunSpec: boolean expected"; + return null; + }; + + /** + * Creates a ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + */ + ServicePerimeter.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeter) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeter(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.perimeterType) { + default: + if (typeof object.perimeterType === "number") { + message.perimeterType = object.perimeterType; + break; + } + break; + case "PERIMETER_TYPE_REGULAR": + case 0: + message.perimeterType = 0; + break; + case "PERIMETER_TYPE_BRIDGE": + case 1: + message.perimeterType = 1; + break; + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.status: object expected"); + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.status); + } + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.spec: object expected"); + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.spec); + } + if (object.useExplicitDryRunSpec != null) + message.useExplicitDryRunSpec = Boolean(object.useExplicitDryRunSpec); + return message; + }; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeter} message ServicePerimeter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.perimeterType = options.enums === String ? "PERIMETER_TYPE_REGULAR" : 0; + object.status = null; + object.spec = null; + object.useExplicitDryRunSpec = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + object.perimeterType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] === undefined ? message.perimeterType : $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] : message.perimeterType; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.status, options); + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.spec, options); + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + object.useExplicitDryRunSpec = message.useExplicitDryRunSpec; + return object; + }; + + /** + * Converts this ServicePerimeter to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServicePerimeter + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeter"; + }; + + /** + * PerimeterType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + * @enum {number} + * @property {number} PERIMETER_TYPE_REGULAR=0 PERIMETER_TYPE_REGULAR value + * @property {number} PERIMETER_TYPE_BRIDGE=1 PERIMETER_TYPE_BRIDGE value + */ + ServicePerimeter.PerimeterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERIMETER_TYPE_REGULAR"] = 0; + values[valuesById[1] = "PERIMETER_TYPE_BRIDGE"] = 1; + return values; + })(); + + return ServicePerimeter; + })(); + + v1.ServicePerimeterConfig = (function() { + + /** + * Properties of a ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeterConfig + * @property {Array.|null} [resources] ServicePerimeterConfig resources + * @property {Array.|null} [accessLevels] ServicePerimeterConfig accessLevels + * @property {Array.|null} [restrictedServices] ServicePerimeterConfig restrictedServices + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null} [vpcAccessibleServices] ServicePerimeterConfig vpcAccessibleServices + * @property {Array.|null} [ingressPolicies] ServicePerimeterConfig ingressPolicies + * @property {Array.|null} [egressPolicies] ServicePerimeterConfig egressPolicies + */ + + /** + * Constructs a new ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeterConfig. + * @implements IServicePerimeterConfig + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + */ + function ServicePerimeterConfig(properties) { + this.resources = []; + this.accessLevels = []; + this.restrictedServices = []; + this.ingressPolicies = []; + this.egressPolicies = []; + 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]]; + } + + /** + * ServicePerimeterConfig resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.resources = $util.emptyArray; + + /** + * ServicePerimeterConfig accessLevels. + * @member {Array.} accessLevels + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.accessLevels = $util.emptyArray; + + /** + * ServicePerimeterConfig restrictedServices. + * @member {Array.} restrictedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.restrictedServices = $util.emptyArray; + + /** + * ServicePerimeterConfig vpcAccessibleServices. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null|undefined} vpcAccessibleServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.vpcAccessibleServices = null; + + /** + * ServicePerimeterConfig ingressPolicies. + * @member {Array.} ingressPolicies + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.ingressPolicies = $util.emptyArray; + + /** + * ServicePerimeterConfig egressPolicies. + * @member {Array.} egressPolicies + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.egressPolicies = $util.emptyArray; + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig instance + */ + ServicePerimeterConfig.create = function create(properties) { + return new ServicePerimeterConfig(properties); + }; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.accessLevels != null && message.accessLevels.length) + for (var i = 0; i < message.accessLevels.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessLevels[i]); + if (message.restrictedServices != null && message.restrictedServices.length) + for (var i = 0; i < message.restrictedServices.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.restrictedServices[i]); + if (message.ingressPolicies != null && message.ingressPolicies.length) + for (var i = 0; i < message.ingressPolicies.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.encode(message.ingressPolicies[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.egressPolicies != null && message.egressPolicies.length) + for (var i = 0; i < message.egressPolicies.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.encode(message.egressPolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.vpcAccessibleServices != null && Object.hasOwnProperty.call(message, "vpcAccessibleServices")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.encode(message.vpcAccessibleServices, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.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.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.accessLevels && message.accessLevels.length)) + message.accessLevels = []; + message.accessLevels.push(reader.string()); + break; + } + case 4: { + if (!(message.restrictedServices && message.restrictedServices.length)) + message.restrictedServices = []; + message.restrictedServices.push(reader.string()); + break; + } + case 10: { + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.ingressPolicies && message.ingressPolicies.length)) + message.ingressPolicies = []; + message.ingressPolicies.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.egressPolicies && message.egressPolicies.length)) + message.egressPolicies = []; + message.egressPolicies.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServicePerimeterConfig message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeterConfig.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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.accessLevels != null && message.hasOwnProperty("accessLevels")) { + if (!Array.isArray(message.accessLevels)) + return "accessLevels: array expected"; + for (var i = 0; i < message.accessLevels.length; ++i) + if (!$util.isString(message.accessLevels[i])) + return "accessLevels: string[] expected"; + } + if (message.restrictedServices != null && message.hasOwnProperty("restrictedServices")) { + if (!Array.isArray(message.restrictedServices)) + return "restrictedServices: array expected"; + for (var i = 0; i < message.restrictedServices.length; ++i) + if (!$util.isString(message.restrictedServices[i])) + return "restrictedServices: string[] expected"; + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify(message.vpcAccessibleServices); + if (error) + return "vpcAccessibleServices." + error; + } + if (message.ingressPolicies != null && message.hasOwnProperty("ingressPolicies")) { + if (!Array.isArray(message.ingressPolicies)) + return "ingressPolicies: array expected"; + for (var i = 0; i < message.ingressPolicies.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify(message.ingressPolicies[i]); + if (error) + return "ingressPolicies." + error; + } + } + if (message.egressPolicies != null && message.hasOwnProperty("egressPolicies")) { + if (!Array.isArray(message.egressPolicies)) + return "egressPolicies: array expected"; + for (var i = 0; i < message.egressPolicies.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify(message.egressPolicies[i]); + if (error) + return "egressPolicies." + error; + } + } + return null; + }; + + /** + * Creates a ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + */ + ServicePerimeterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.accessLevels) { + if (!Array.isArray(object.accessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.accessLevels: array expected"); + message.accessLevels = []; + for (var i = 0; i < object.accessLevels.length; ++i) + message.accessLevels[i] = String(object.accessLevels[i]); + } + if (object.restrictedServices) { + if (!Array.isArray(object.restrictedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.restrictedServices: array expected"); + message.restrictedServices = []; + for (var i = 0; i < object.restrictedServices.length; ++i) + message.restrictedServices[i] = String(object.restrictedServices[i]); + } + if (object.vpcAccessibleServices != null) { + if (typeof object.vpcAccessibleServices !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.vpcAccessibleServices: object expected"); + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.fromObject(object.vpcAccessibleServices); + } + if (object.ingressPolicies) { + if (!Array.isArray(object.ingressPolicies)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ingressPolicies: array expected"); + message.ingressPolicies = []; + for (var i = 0; i < object.ingressPolicies.length; ++i) { + if (typeof object.ingressPolicies[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ingressPolicies: object expected"); + message.ingressPolicies[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.fromObject(object.ingressPolicies[i]); + } + } + if (object.egressPolicies) { + if (!Array.isArray(object.egressPolicies)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.egressPolicies: array expected"); + message.egressPolicies = []; + for (var i = 0; i < object.egressPolicies.length; ++i) { + if (typeof object.egressPolicies[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.egressPolicies: object expected"); + message.egressPolicies[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.fromObject(object.egressPolicies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} message ServicePerimeterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accessLevels = []; + object.restrictedServices = []; + object.ingressPolicies = []; + object.egressPolicies = []; + } + if (options.defaults) + object.vpcAccessibleServices = null; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.accessLevels && message.accessLevels.length) { + object.accessLevels = []; + for (var j = 0; j < message.accessLevels.length; ++j) + object.accessLevels[j] = message.accessLevels[j]; + } + if (message.restrictedServices && message.restrictedServices.length) { + object.restrictedServices = []; + for (var j = 0; j < message.restrictedServices.length; ++j) + object.restrictedServices[j] = message.restrictedServices[j]; + } + if (message.ingressPolicies && message.ingressPolicies.length) { + object.ingressPolicies = []; + for (var j = 0; j < message.ingressPolicies.length; ++j) + object.ingressPolicies[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.toObject(message.ingressPolicies[j], options); + } + if (message.egressPolicies && message.egressPolicies.length) { + object.egressPolicies = []; + for (var j = 0; j < message.egressPolicies.length; ++j) + object.egressPolicies[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.toObject(message.egressPolicies[j], options); + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) + object.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.toObject(message.vpcAccessibleServices, options); + return object; + }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig"; + }; + + ServicePerimeterConfig.VpcAccessibleServices = (function() { + + /** + * Properties of a VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IVpcAccessibleServices + * @property {boolean|null} [enableRestriction] VpcAccessibleServices enableRestriction + * @property {Array.|null} [allowedServices] VpcAccessibleServices allowedServices + */ + + /** + * Constructs a new VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a VpcAccessibleServices. + * @implements IVpcAccessibleServices + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + */ + function VpcAccessibleServices(properties) { + this.allowedServices = []; + 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]]; + } + + /** + * VpcAccessibleServices enableRestriction. + * @member {boolean} enableRestriction + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.enableRestriction = false; + + /** + * VpcAccessibleServices allowedServices. + * @member {Array.} allowedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.allowedServices = $util.emptyArray; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices instance + */ + VpcAccessibleServices.create = function create(properties) { + return new VpcAccessibleServices(properties); + }; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRestriction != null && Object.hasOwnProperty.call(message, "enableRestriction")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRestriction); + if (message.allowedServices != null && message.allowedServices.length) + for (var i = 0; i < message.allowedServices.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedServices[i]); + return writer; + }; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableRestriction = reader.bool(); + break; + } + case 2: { + if (!(message.allowedServices && message.allowedServices.length)) + message.allowedServices = []; + message.allowedServices.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcAccessibleServices message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcAccessibleServices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + if (typeof message.enableRestriction !== "boolean") + return "enableRestriction: boolean expected"; + if (message.allowedServices != null && message.hasOwnProperty("allowedServices")) { + if (!Array.isArray(message.allowedServices)) + return "allowedServices: array expected"; + for (var i = 0; i < message.allowedServices.length; ++i) + if (!$util.isString(message.allowedServices[i])) + return "allowedServices: string[] expected"; + } + return null; + }; + + /** + * Creates a VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + */ + VpcAccessibleServices.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + if (object.enableRestriction != null) + message.enableRestriction = Boolean(object.enableRestriction); + if (object.allowedServices) { + if (!Array.isArray(object.allowedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.allowedServices: array expected"); + message.allowedServices = []; + for (var i = 0; i < object.allowedServices.length; ++i) + message.allowedServices[i] = String(object.allowedServices[i]); + } + return message; + }; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} message VpcAccessibleServices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcAccessibleServices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedServices = []; + if (options.defaults) + object.enableRestriction = false; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + object.enableRestriction = message.enableRestriction; + if (message.allowedServices && message.allowedServices.length) { + object.allowedServices = []; + for (var j = 0; j < message.allowedServices.length; ++j) + object.allowedServices[j] = message.allowedServices[j]; + } + return object; + }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + * @returns {Object.} JSON object + */ + VpcAccessibleServices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcAccessibleServices + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcAccessibleServices.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices"; + }; + + return VpcAccessibleServices; + })(); + + /** + * IdentityType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType + * @enum {number} + * @property {number} IDENTITY_TYPE_UNSPECIFIED=0 IDENTITY_TYPE_UNSPECIFIED value + * @property {number} ANY_IDENTITY=1 ANY_IDENTITY value + * @property {number} ANY_USER_ACCOUNT=2 ANY_USER_ACCOUNT value + * @property {number} ANY_SERVICE_ACCOUNT=3 ANY_SERVICE_ACCOUNT value + */ + ServicePerimeterConfig.IdentityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDENTITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ANY_IDENTITY"] = 1; + values[valuesById[2] = "ANY_USER_ACCOUNT"] = 2; + values[valuesById[3] = "ANY_SERVICE_ACCOUNT"] = 3; + return values; + })(); + + ServicePerimeterConfig.MethodSelector = (function() { + + /** + * Properties of a MethodSelector. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IMethodSelector + * @property {string|null} [method] MethodSelector method + * @property {string|null} [permission] MethodSelector permission + */ + + /** + * Constructs a new MethodSelector. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a MethodSelector. + * @implements IMethodSelector + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector=} [properties] Properties to set + */ + function MethodSelector(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]]; + } + + /** + * MethodSelector method. + * @member {string|null|undefined} method + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + MethodSelector.prototype.method = null; + + /** + * MethodSelector permission. + * @member {string|null|undefined} permission + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + MethodSelector.prototype.permission = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MethodSelector kind. + * @member {"method"|"permission"|undefined} kind + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + Object.defineProperty(MethodSelector.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["method", "permission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MethodSelector instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector instance + */ + MethodSelector.create = function create(properties) { + return new MethodSelector(properties); + }; + + /** + * Encodes the specified MethodSelector message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector} message MethodSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.method); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + return writer; + }; + + /** + * Encodes the specified MethodSelector message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector} message MethodSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSelector message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSelector.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.method = reader.string(); + break; + } + case 2: { + message.permission = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSelector message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.method != null && message.hasOwnProperty("method")) { + properties.kind = 1; + if (!$util.isString(message.method)) + return "method: string expected"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.permission)) + return "permission: string expected"; + } + return null; + }; + + /** + * Creates a MethodSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + */ + MethodSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector(); + if (object.method != null) + message.method = String(object.method); + if (object.permission != null) + message.permission = String(object.permission); + return message; + }; + + /** + * Creates a plain object from a MethodSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} message MethodSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.method != null && message.hasOwnProperty("method")) { + object.method = message.method; + if (options.oneofs) + object.kind = "method"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + object.permission = message.permission; + if (options.oneofs) + object.kind = "permission"; + } + return object; + }; + + /** + * Converts this MethodSelector to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + * @returns {Object.} JSON object + */ + MethodSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSelector + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector"; + }; + + return MethodSelector; + })(); + + ServicePerimeterConfig.ApiOperation = (function() { + + /** + * Properties of an ApiOperation. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IApiOperation + * @property {string|null} [serviceName] ApiOperation serviceName + * @property {Array.|null} [methodSelectors] ApiOperation methodSelectors + */ + + /** + * Constructs a new ApiOperation. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an ApiOperation. + * @implements IApiOperation + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation=} [properties] Properties to set + */ + function ApiOperation(properties) { + this.methodSelectors = []; + 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]]; + } + + /** + * ApiOperation serviceName. + * @member {string} serviceName + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + */ + ApiOperation.prototype.serviceName = ""; + + /** + * ApiOperation methodSelectors. + * @member {Array.} methodSelectors + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + */ + ApiOperation.prototype.methodSelectors = $util.emptyArray; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation instance + */ + ApiOperation.create = function create(properties) { + return new ApiOperation(properties); + }; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.methodSelectors != null && message.methodSelectors.length) + for (var i = 0; i < message.methodSelectors.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.encode(message.methodSelectors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + if (!(message.methodSelectors && message.methodSelectors.length)) + message.methodSelectors = []; + message.methodSelectors.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiOperation message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.methodSelectors != null && message.hasOwnProperty("methodSelectors")) { + if (!Array.isArray(message.methodSelectors)) + return "methodSelectors: array expected"; + for (var i = 0; i < message.methodSelectors.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify(message.methodSelectors[i]); + if (error) + return "methodSelectors." + error; + } + } + return null; + }; + + /** + * Creates an ApiOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + */ + ApiOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.methodSelectors) { + if (!Array.isArray(object.methodSelectors)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.methodSelectors: array expected"); + message.methodSelectors = []; + for (var i = 0; i < object.methodSelectors.length; ++i) { + if (typeof object.methodSelectors[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.methodSelectors: object expected"); + message.methodSelectors[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.fromObject(object.methodSelectors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} message ApiOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methodSelectors = []; + if (options.defaults) + object.serviceName = ""; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.methodSelectors && message.methodSelectors.length) { + object.methodSelectors = []; + for (var j = 0; j < message.methodSelectors.length; ++j) + object.methodSelectors[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.toObject(message.methodSelectors[j], options); + } + return object; + }; + + /** + * Converts this ApiOperation to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + * @returns {Object.} JSON object + */ + ApiOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiOperation + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation"; + }; + + return ApiOperation; + })(); + + ServicePerimeterConfig.IngressSource = (function() { + + /** + * Properties of an IngressSource. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressSource + * @property {string|null} [accessLevel] IngressSource accessLevel + * @property {string|null} [resource] IngressSource resource + */ + + /** + * Constructs a new IngressSource. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressSource. + * @implements IIngressSource + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource=} [properties] Properties to set + */ + function IngressSource(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]]; + } + + /** + * IngressSource accessLevel. + * @member {string|null|undefined} accessLevel + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + IngressSource.prototype.accessLevel = null; + + /** + * IngressSource resource. + * @member {string|null|undefined} resource + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + IngressSource.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngressSource source. + * @member {"accessLevel"|"resource"|undefined} source + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + Object.defineProperty(IngressSource.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["accessLevel", "resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngressSource instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource instance + */ + IngressSource.create = function create(properties) { + return new IngressSource(properties); + }; + + /** + * Encodes the specified IngressSource message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource} message IngressSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessLevel); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + return writer; + }; + + /** + * Encodes the specified IngressSource message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource} message IngressSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressSource message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressSource.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessLevel = reader.string(); + break; + } + case 2: { + message.resource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressSource message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + properties.source = 1; + if (!$util.isString(message.accessLevel)) + return "accessLevel: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.resource)) + return "resource: string expected"; + } + return null; + }; + + /** + * Creates an IngressSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + */ + IngressSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource(); + if (object.accessLevel != null) + message.accessLevel = String(object.accessLevel); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from an IngressSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} message IngressSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = message.accessLevel; + if (options.oneofs) + object.source = "accessLevel"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = message.resource; + if (options.oneofs) + object.source = "resource"; + } + return object; + }; + + /** + * Converts this IngressSource to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + * @returns {Object.} JSON object + */ + IngressSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressSource + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource"; + }; + + return IngressSource; + })(); + + ServicePerimeterConfig.IngressFrom = (function() { + + /** + * Properties of an IngressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressFrom + * @property {Array.|null} [sources] IngressFrom sources + * @property {Array.|null} [identities] IngressFrom identities + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null} [identityType] IngressFrom identityType + */ + + /** + * Constructs a new IngressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressFrom. + * @implements IIngressFrom + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom=} [properties] Properties to set + */ + function IngressFrom(properties) { + this.sources = []; + this.identities = []; + 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]]; + } + + /** + * IngressFrom sources. + * @member {Array.} sources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.sources = $util.emptyArray; + + /** + * IngressFrom identities. + * @member {Array.} identities + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.identities = $util.emptyArray; + + /** + * IngressFrom identityType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType} identityType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.identityType = 0; + + /** + * Creates a new IngressFrom instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom instance + */ + IngressFrom.create = function create(properties) { + return new IngressFrom(properties); + }; + + /** + * Encodes the specified IngressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom} message IngressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressFrom.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.identities[i]); + if (message.identityType != null && Object.hasOwnProperty.call(message, "identityType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.identityType); + return writer; + }; + + /** + * Encodes the specified IngressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom} message IngressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressFrom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressFrom message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressFrom.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.string()); + break; + } + case 3: { + message.identityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressFrom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressFrom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressFrom message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressFrom.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + 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) + if (!$util.isString(message.identities[i])) + return "identities: string[] expected"; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + switch (message.identityType) { + default: + return "identityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an IngressFrom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + */ + IngressFrom.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.sources: object expected"); + message.sources[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.fromObject(object.sources[i]); + } + } + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + message.identities[i] = String(object.identities[i]); + } + switch (object.identityType) { + default: + if (typeof object.identityType === "number") { + message.identityType = object.identityType; + break; + } + break; + case "IDENTITY_TYPE_UNSPECIFIED": + case 0: + message.identityType = 0; + break; + case "ANY_IDENTITY": + case 1: + message.identityType = 1; + break; + case "ANY_USER_ACCOUNT": + case 2: + message.identityType = 2; + break; + case "ANY_SERVICE_ACCOUNT": + case 3: + message.identityType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an IngressFrom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} message IngressFrom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressFrom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.identities = []; + } + if (options.defaults) + object.identityType = options.enums === String ? "IDENTITY_TYPE_UNSPECIFIED" : 0; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.toObject(message.sources[j], options); + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = message.identities[j]; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + object.identityType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] === undefined ? message.identityType : $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] : message.identityType; + return object; + }; + + /** + * Converts this IngressFrom to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + * @returns {Object.} JSON object + */ + IngressFrom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressFrom + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressFrom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom"; + }; + + return IngressFrom; + })(); + + ServicePerimeterConfig.IngressTo = (function() { + + /** + * Properties of an IngressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressTo + * @property {Array.|null} [operations] IngressTo operations + * @property {Array.|null} [resources] IngressTo resources + */ + + /** + * Constructs a new IngressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressTo. + * @implements IIngressTo + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo=} [properties] Properties to set + */ + function IngressTo(properties) { + this.operations = []; + this.resources = []; + 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]]; + } + + /** + * IngressTo operations. + * @member {Array.} operations + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + */ + IngressTo.prototype.operations = $util.emptyArray; + + /** + * IngressTo resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + */ + IngressTo.prototype.resources = $util.emptyArray; + + /** + * Creates a new IngressTo instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo instance + */ + IngressTo.create = function create(properties) { + return new IngressTo(properties); + }; + + /** + * Encodes the specified IngressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo} message IngressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressTo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resources[i]); + return writer; + }; + + /** + * Encodes the specified IngressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo} message IngressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressTo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressTo message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressTo.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressTo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressTo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressTo message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressTo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + 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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + return null; + }; + + /** + * Creates an IngressTo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + */ + IngressTo.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.operations: object expected"); + message.operations[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.fromObject(object.operations[i]); + } + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + return message; + }; + + /** + * Creates a plain object from an IngressTo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} message IngressTo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressTo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.operations = []; + object.resources = []; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.toObject(message.operations[j], options); + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + return object; + }; + + /** + * Converts this IngressTo to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + * @returns {Object.} JSON object + */ + IngressTo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressTo + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressTo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo"; + }; + + return IngressTo; + })(); + + ServicePerimeterConfig.IngressPolicy = (function() { + + /** + * Properties of an IngressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressPolicy + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null} [ingressFrom] IngressPolicy ingressFrom + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null} [ingressTo] IngressPolicy ingressTo + */ + + /** + * Constructs a new IngressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressPolicy. + * @implements IIngressPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy=} [properties] Properties to set + */ + function IngressPolicy(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]]; + } + + /** + * IngressPolicy ingressFrom. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null|undefined} ingressFrom + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + */ + IngressPolicy.prototype.ingressFrom = null; + + /** + * IngressPolicy ingressTo. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null|undefined} ingressTo + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + */ + IngressPolicy.prototype.ingressTo = null; + + /** + * Creates a new IngressPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy instance + */ + IngressPolicy.create = function create(properties) { + return new IngressPolicy(properties); + }; + + /** + * Encodes the specified IngressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy} message IngressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingressFrom != null && Object.hasOwnProperty.call(message, "ingressFrom")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.encode(message.ingressFrom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ingressTo != null && Object.hasOwnProperty.call(message, "ingressTo")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.encode(message.ingressTo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy} message IngressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressPolicy.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ingressFrom != null && message.hasOwnProperty("ingressFrom")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify(message.ingressFrom); + if (error) + return "ingressFrom." + error; + } + if (message.ingressTo != null && message.hasOwnProperty("ingressTo")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify(message.ingressTo); + if (error) + return "ingressTo." + error; + } + return null; + }; + + /** + * Creates an IngressPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + */ + IngressPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy(); + if (object.ingressFrom != null) { + if (typeof object.ingressFrom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.ingressFrom: object expected"); + message.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.fromObject(object.ingressFrom); + } + if (object.ingressTo != null) { + if (typeof object.ingressTo !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.ingressTo: object expected"); + message.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.fromObject(object.ingressTo); + } + return message; + }; + + /** + * Creates a plain object from an IngressPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} message IngressPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ingressFrom = null; + object.ingressTo = null; + } + if (message.ingressFrom != null && message.hasOwnProperty("ingressFrom")) + object.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.toObject(message.ingressFrom, options); + if (message.ingressTo != null && message.hasOwnProperty("ingressTo")) + object.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.toObject(message.ingressTo, options); + return object; + }; + + /** + * Converts this IngressPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + * @returns {Object.} JSON object + */ + IngressPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy"; + }; + + return IngressPolicy; + })(); + + ServicePerimeterConfig.EgressFrom = (function() { + + /** + * Properties of an EgressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressFrom + * @property {Array.|null} [identities] EgressFrom identities + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null} [identityType] EgressFrom identityType + */ + + /** + * Constructs a new EgressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressFrom. + * @implements IEgressFrom + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom=} [properties] Properties to set + */ + function EgressFrom(properties) { + this.identities = []; + 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]]; + } + + /** + * EgressFrom identities. + * @member {Array.} identities + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + */ + EgressFrom.prototype.identities = $util.emptyArray; + + /** + * EgressFrom identityType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType} identityType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + */ + EgressFrom.prototype.identityType = 0; + + /** + * Creates a new EgressFrom instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom instance + */ + EgressFrom.create = function create(properties) { + return new EgressFrom(properties); + }; + + /** + * Encodes the specified EgressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom} message EgressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressFrom.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identities[i]); + if (message.identityType != null && Object.hasOwnProperty.call(message, "identityType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.identityType); + return writer; + }; + + /** + * Encodes the specified EgressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom} message EgressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressFrom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressFrom message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressFrom.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.string()); + break; + } + case 2: { + message.identityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressFrom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressFrom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressFrom message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressFrom.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) + if (!$util.isString(message.identities[i])) + return "identities: string[] expected"; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + switch (message.identityType) { + default: + return "identityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an EgressFrom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + */ + EgressFrom.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + message.identities[i] = String(object.identities[i]); + } + switch (object.identityType) { + default: + if (typeof object.identityType === "number") { + message.identityType = object.identityType; + break; + } + break; + case "IDENTITY_TYPE_UNSPECIFIED": + case 0: + message.identityType = 0; + break; + case "ANY_IDENTITY": + case 1: + message.identityType = 1; + break; + case "ANY_USER_ACCOUNT": + case 2: + message.identityType = 2; + break; + case "ANY_SERVICE_ACCOUNT": + case 3: + message.identityType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an EgressFrom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} message EgressFrom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressFrom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identities = []; + if (options.defaults) + object.identityType = options.enums === String ? "IDENTITY_TYPE_UNSPECIFIED" : 0; + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = message.identities[j]; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + object.identityType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] === undefined ? message.identityType : $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] : message.identityType; + return object; + }; + + /** + * Converts this EgressFrom to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + * @returns {Object.} JSON object + */ + EgressFrom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressFrom + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressFrom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom"; + }; + + return EgressFrom; + })(); + + ServicePerimeterConfig.EgressTo = (function() { + + /** + * Properties of an EgressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressTo + * @property {Array.|null} [resources] EgressTo resources + * @property {Array.|null} [operations] EgressTo operations + * @property {Array.|null} [externalResources] EgressTo externalResources + */ + + /** + * Constructs a new EgressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressTo. + * @implements IEgressTo + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo=} [properties] Properties to set + */ + function EgressTo(properties) { + this.resources = []; + this.operations = []; + this.externalResources = []; + 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]]; + } + + /** + * EgressTo resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.resources = $util.emptyArray; + + /** + * EgressTo operations. + * @member {Array.} operations + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.operations = $util.emptyArray; + + /** + * EgressTo externalResources. + * @member {Array.} externalResources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.externalResources = $util.emptyArray; + + /** + * Creates a new EgressTo instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo instance + */ + EgressTo.create = function create(properties) { + return new EgressTo(properties); + }; + + /** + * Encodes the specified EgressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo} message EgressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressTo.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.encode(message.operations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.externalResources != null && message.externalResources.length) + for (var i = 0; i < message.externalResources.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalResources[i]); + return writer; + }; + + /** + * Encodes the specified EgressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo} message EgressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressTo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressTo message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressTo.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.externalResources && message.externalResources.length)) + message.externalResources = []; + message.externalResources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressTo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressTo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressTo message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressTo.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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.externalResources != null && message.hasOwnProperty("externalResources")) { + if (!Array.isArray(message.externalResources)) + return "externalResources: array expected"; + for (var i = 0; i < message.externalResources.length; ++i) + if (!$util.isString(message.externalResources[i])) + return "externalResources: string[] expected"; + } + return null; + }; + + /** + * Creates an EgressTo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + */ + EgressTo.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.operations: object expected"); + message.operations[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.fromObject(object.operations[i]); + } + } + if (object.externalResources) { + if (!Array.isArray(object.externalResources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.externalResources: array expected"); + message.externalResources = []; + for (var i = 0; i < object.externalResources.length; ++i) + message.externalResources[i] = String(object.externalResources[i]); + } + return message; + }; + + /** + * Creates a plain object from an EgressTo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} message EgressTo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressTo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.operations = []; + object.externalResources = []; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.toObject(message.operations[j], options); + } + if (message.externalResources && message.externalResources.length) { + object.externalResources = []; + for (var j = 0; j < message.externalResources.length; ++j) + object.externalResources[j] = message.externalResources[j]; + } + return object; + }; + + /** + * Converts this EgressTo to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + * @returns {Object.} JSON object + */ + EgressTo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressTo + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressTo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo"; + }; + + return EgressTo; + })(); + + ServicePerimeterConfig.EgressPolicy = (function() { + + /** + * Properties of an EgressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressPolicy + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null} [egressFrom] EgressPolicy egressFrom + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null} [egressTo] EgressPolicy egressTo + */ + + /** + * Constructs a new EgressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressPolicy. + * @implements IEgressPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy=} [properties] Properties to set + */ + function EgressPolicy(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]]; + } + + /** + * EgressPolicy egressFrom. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null|undefined} egressFrom + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + */ + EgressPolicy.prototype.egressFrom = null; + + /** + * EgressPolicy egressTo. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null|undefined} egressTo + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + */ + EgressPolicy.prototype.egressTo = null; + + /** + * Creates a new EgressPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy instance + */ + EgressPolicy.create = function create(properties) { + return new EgressPolicy(properties); + }; + + /** + * Encodes the specified EgressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy} message EgressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.egressFrom != null && Object.hasOwnProperty.call(message, "egressFrom")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.encode(message.egressFrom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.egressTo != null && Object.hasOwnProperty.call(message, "egressTo")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.encode(message.egressTo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EgressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy} message EgressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressPolicy.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.decode(reader, reader.uint32()); + break; + } + case 2: { + message.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.egressFrom != null && message.hasOwnProperty("egressFrom")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify(message.egressFrom); + if (error) + return "egressFrom." + error; + } + if (message.egressTo != null && message.hasOwnProperty("egressTo")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify(message.egressTo); + if (error) + return "egressTo." + error; + } + return null; + }; + + /** + * Creates an EgressPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + */ + EgressPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy(); + if (object.egressFrom != null) { + if (typeof object.egressFrom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.egressFrom: object expected"); + message.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.fromObject(object.egressFrom); + } + if (object.egressTo != null) { + if (typeof object.egressTo !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.egressTo: object expected"); + message.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.fromObject(object.egressTo); + } + return message; + }; + + /** + * Creates a plain object from an EgressPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} message EgressPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.egressFrom = null; + object.egressTo = null; + } + if (message.egressFrom != null && message.hasOwnProperty("egressFrom")) + object.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.toObject(message.egressFrom, options); + if (message.egressTo != null && message.hasOwnProperty("egressTo")) + object.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.toObject(message.egressTo, options); + return object; + }; + + /** + * Converts this EgressPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + * @returns {Object.} JSON object + */ + EgressPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy"; + }; + + return EgressPolicy; + })(); + + return ServicePerimeterConfig; + })(); + + return v1; + })(); + + accesscontextmanager.type = (function() { + + /** + * Namespace type. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var type = {}; + + /** + * DeviceEncryptionStatus enum. + * @name google.identity.accesscontextmanager.type.DeviceEncryptionStatus + * @enum {number} + * @property {number} ENCRYPTION_UNSPECIFIED=0 ENCRYPTION_UNSPECIFIED value + * @property {number} ENCRYPTION_UNSUPPORTED=1 ENCRYPTION_UNSUPPORTED value + * @property {number} UNENCRYPTED=2 UNENCRYPTED value + * @property {number} ENCRYPTED=3 ENCRYPTED value + */ + type.DeviceEncryptionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENCRYPTION_UNSUPPORTED"] = 1; + values[valuesById[2] = "UNENCRYPTED"] = 2; + values[valuesById[3] = "ENCRYPTED"] = 3; + return values; + })(); + + /** + * OsType enum. + * @name google.identity.accesscontextmanager.type.OsType + * @enum {number} + * @property {number} OS_UNSPECIFIED=0 OS_UNSPECIFIED value + * @property {number} DESKTOP_MAC=1 DESKTOP_MAC value + * @property {number} DESKTOP_WINDOWS=2 DESKTOP_WINDOWS value + * @property {number} DESKTOP_LINUX=3 DESKTOP_LINUX value + * @property {number} DESKTOP_CHROME_OS=6 DESKTOP_CHROME_OS value + * @property {number} ANDROID=4 ANDROID value + * @property {number} IOS=5 IOS value + */ + type.OsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OS_UNSPECIFIED"] = 0; + values[valuesById[1] = "DESKTOP_MAC"] = 1; + values[valuesById[2] = "DESKTOP_WINDOWS"] = 2; + values[valuesById[3] = "DESKTOP_LINUX"] = 3; + values[valuesById[6] = "DESKTOP_CHROME_OS"] = 6; + values[valuesById[4] = "ANDROID"] = 4; + values[valuesById[5] = "IOS"] = 5; + return values; + })(); + + /** + * DeviceManagementLevel enum. + * @name google.identity.accesscontextmanager.type.DeviceManagementLevel + * @enum {number} + * @property {number} MANAGEMENT_UNSPECIFIED=0 MANAGEMENT_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} BASIC=2 BASIC value + * @property {number} COMPLETE=3 COMPLETE value + */ + type.DeviceManagementLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANAGEMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "BASIC"] = 2; + values[valuesById[3] = "COMPLETE"] = 3; + return values; + })(); + + return type; + })(); + + return accesscontextmanager; + })(); + + return identity; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.json b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.json new file mode 100644 index 00000000000..cfa4ff9a11d --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/protos/protos.json @@ -0,0 +1,2875 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "asset": { + "nested": { + "v1p5beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1p5Beta1", + "go_package": "cloud.google.com/go/asset/apiv1p5beta1/assetpb;assetpb", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p5beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p5beta1" + }, + "nested": { + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAssets": { + "requestType": "ListAssetsRequest", + "responseType": "ListAssetsResponse", + "options": { + "(google.api.http).get": "/v1p5beta1/{parent=*/*}/assets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1p5beta1/{parent=*/*}/assets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ListAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 5 + }, + "pageToken": { + "type": "string", + "id": 6 + } + } + }, + "ListAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "assets": { + "rule": "repeated", + "type": "Asset", + "id": 2 + }, + "nextPageToken": { + "type": "string", + "id": 3 + } + } + }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2, + "ORG_POLICY": 4, + "ACCESS_POLICY": 5 + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, + "oneofs": { + "accessContextPolicy": { + "oneof": [ + "accessPolicy", + "accessLevel", + "servicePerimeter" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "orgPolicy": { + "rule": "repeated", + "type": "google.cloud.orgpolicy.v1.Policy", + "id": 6 + }, + "accessPolicy": { + "type": "google.identity.accesscontextmanager.v1.AccessPolicy", + "id": 7 + }, + "accessLevel": { + "type": "google.identity.accesscontextmanager.v1.AccessLevel", + "id": 8 + }, + "servicePerimeter": { + "type": "google.identity.accesscontextmanager.v1.ServicePerimeter", + "id": 9 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 10 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + } + } + } + } + }, + "orgpolicy": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OrgPolicy.V1", + "go_package": "cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb", + "java_multiple_files": true, + "java_outer_classname": "OrgPolicyProto", + "java_package": "com.google.cloud.orgpolicy.v1", + "php_namespace": "Google\\Cloud\\OrgPolicy\\V1", + "ruby_package": "Google::Cloud::OrgPolicy::V1" + }, + "nested": { + "Policy": { + "oneofs": { + "policyType": { + "oneof": [ + "listPolicy", + "booleanPolicy", + "restoreDefault" + ] + } + }, + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "constraint": { + "type": "string", + "id": 2 + }, + "etag": { + "type": "bytes", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "listPolicy": { + "type": "ListPolicy", + "id": 5 + }, + "booleanPolicy": { + "type": "BooleanPolicy", + "id": 6 + }, + "restoreDefault": { + "type": "RestoreDefault", + "id": 7 + } + }, + "nested": { + "ListPolicy": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "deniedValues": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "allValues": { + "type": "AllValues", + "id": 3 + }, + "suggestedValue": { + "type": "string", + "id": 4 + }, + "inheritFromParent": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "AllValues": { + "values": { + "ALL_VALUES_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 + } + } + } + }, + "BooleanPolicy": { + "fields": { + "enforced": { + "type": "bool", + "id": 1 + } + } + }, + "RestoreDefault": { + "fields": {} + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "identity": { + "nested": { + "accesscontextmanager": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.V1", + "go_package": "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb", + "java_multiple_files": true, + "java_outer_classname": "ServicePerimeterProto", + "java_package": "com.google.identity.accesscontextmanager.v1", + "objc_class_prefix": "GACM", + "php_namespace": "Google\\Identity\\AccessContextManager\\V1", + "ruby_package": "Google::Identity::AccessContextManager::V1" + }, + "nested": { + "AccessLevel": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/AccessLevel", + "(google.api.resource).pattern": "accessPolicies/{access_policy}/accessLevels/{access_level}" + }, + "oneofs": { + "level": { + "oneof": [ + "basic", + "custom" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "basic": { + "type": "BasicLevel", + "id": 4 + }, + "custom": { + "type": "CustomLevel", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "BasicLevel": { + "fields": { + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 1 + }, + "combiningFunction": { + "type": "ConditionCombiningFunction", + "id": 2 + } + }, + "nested": { + "ConditionCombiningFunction": { + "values": { + "AND": 0, + "OR": 1 + } + } + } + }, + "Condition": { + "fields": { + "ipSubnetworks": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "devicePolicy": { + "type": "DevicePolicy", + "id": 2 + }, + "requiredAccessLevels": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "negate": { + "type": "bool", + "id": 5 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "regions": { + "rule": "repeated", + "type": "string", + "id": 7 + } + } + }, + "CustomLevel": { + "fields": { + "expr": { + "type": "google.type.Expr", + "id": 1 + } + } + }, + "DevicePolicy": { + "fields": { + "requireScreenlock": { + "type": "bool", + "id": 1 + }, + "allowedEncryptionStatuses": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceEncryptionStatus", + "id": 2 + }, + "osConstraints": { + "rule": "repeated", + "type": "OsConstraint", + "id": 3 + }, + "allowedDeviceManagementLevels": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceManagementLevel", + "id": 6 + }, + "requireAdminApproval": { + "type": "bool", + "id": 7 + }, + "requireCorpOwned": { + "type": "bool", + "id": 8 + } + } + }, + "OsConstraint": { + "fields": { + "osType": { + "type": "google.identity.accesscontextmanager.type.OsType", + "id": 1 + }, + "minimumVersion": { + "type": "string", + "id": 2 + }, + "requireVerifiedChromeOs": { + "type": "bool", + "id": 3 + } + } + }, + "AccessPolicy": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/AccessPolicy", + "(google.api.resource).pattern": "accessPolicies/{access_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "title": { + "type": "string", + "id": 3 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + }, + "ServicePerimeter": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/ServicePerimeter", + "(google.api.resource).pattern": "accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "perimeterType": { + "type": "PerimeterType", + "id": 6 + }, + "status": { + "type": "ServicePerimeterConfig", + "id": 7 + }, + "spec": { + "type": "ServicePerimeterConfig", + "id": 8 + }, + "useExplicitDryRunSpec": { + "type": "bool", + "id": 9 + } + }, + "nested": { + "PerimeterType": { + "values": { + "PERIMETER_TYPE_REGULAR": 0, + "PERIMETER_TYPE_BRIDGE": 1 + } + } + } + }, + "ServicePerimeterConfig": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "accessLevels": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "restrictedServices": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "vpcAccessibleServices": { + "type": "VpcAccessibleServices", + "id": 10 + }, + "ingressPolicies": { + "rule": "repeated", + "type": "IngressPolicy", + "id": 8 + }, + "egressPolicies": { + "rule": "repeated", + "type": "EgressPolicy", + "id": 9 + } + }, + "nested": { + "VpcAccessibleServices": { + "fields": { + "enableRestriction": { + "type": "bool", + "id": 1 + }, + "allowedServices": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "IdentityType": { + "values": { + "IDENTITY_TYPE_UNSPECIFIED": 0, + "ANY_IDENTITY": 1, + "ANY_USER_ACCOUNT": 2, + "ANY_SERVICE_ACCOUNT": 3 + } + }, + "MethodSelector": { + "oneofs": { + "kind": { + "oneof": [ + "method", + "permission" + ] + } + }, + "fields": { + "method": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + } + } + }, + "ApiOperation": { + "fields": { + "serviceName": { + "type": "string", + "id": 1 + }, + "methodSelectors": { + "rule": "repeated", + "type": "MethodSelector", + "id": 2 + } + } + }, + "IngressSource": { + "oneofs": { + "source": { + "oneof": [ + "accessLevel", + "resource" + ] + } + }, + "fields": { + "accessLevel": { + "type": "string", + "id": 1 + }, + "resource": { + "type": "string", + "id": 2 + } + } + }, + "IngressFrom": { + "fields": { + "sources": { + "rule": "repeated", + "type": "IngressSource", + "id": 1 + }, + "identities": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "identityType": { + "type": "IdentityType", + "id": 3 + } + } + }, + "IngressTo": { + "fields": { + "operations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 1 + }, + "resources": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "IngressPolicy": { + "fields": { + "ingressFrom": { + "type": "IngressFrom", + "id": 1 + }, + "ingressTo": { + "type": "IngressTo", + "id": 2 + } + } + }, + "EgressFrom": { + "fields": { + "identities": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "identityType": { + "type": "IdentityType", + "id": 2 + } + } + }, + "EgressTo": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "operations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 2 + }, + "externalResources": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "EgressPolicy": { + "fields": { + "egressFrom": { + "type": "EgressFrom", + "id": 1 + }, + "egressTo": { + "type": "EgressTo", + "id": 2 + } + } + } + } + } + } + }, + "type": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.Type", + "go_package": "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type", + "java_package": "com.google.identity.accesscontextmanager.type", + "java_multiple_files": true, + "java_outer_classname": "TypeProto", + "php_namespace": "Google\\Identity\\AccessContextManager\\Type", + "ruby_package": "Google::Identity::AccessContextManager::Type" + }, + "nested": { + "DeviceEncryptionStatus": { + "values": { + "ENCRYPTION_UNSPECIFIED": 0, + "ENCRYPTION_UNSUPPORTED": 1, + "UNENCRYPTED": 2, + "ENCRYPTED": 3 + } + }, + "OsType": { + "values": { + "OS_UNSPECIFIED": 0, + "DESKTOP_MAC": 1, + "DESKTOP_WINDOWS": 2, + "DESKTOP_LINUX": 3, + "DESKTOP_CHROME_OS": 6, + "ANDROID": 4, + "IOS": 5 + } + }, + "DeviceManagementLevel": { + "values": { + "MANAGEMENT_UNSPECIFIED": 0, + "NONE": 1, + "BASIC": 2, + "COMPLETE": 3 + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/samples/generated/v1p5beta1/asset_service.list_assets.js b/owl-bot-staging/google-cloud-asset/v1p5beta1/samples/generated/v1p5beta1/asset_service.list_assets.js new file mode 100644 index 00000000000..8a9dc5cb277 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/samples/generated/v1p5beta1/asset_service.list_assets.js @@ -0,0 +1,107 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudasset_v1p5beta1_generated_AssetService_ListAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), or + * "projects/[project-number]" (such as "projects/12345"). + */ + // const parent = 'abc123' + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + */ + // const readTime = {} + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expression is also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + */ + // const assetTypes = ['abc','def'] + /** + * Asset content type. If not specified, no content but the asset name will + * be returned. + */ + // const contentType = {} + /** + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + */ + // const pageSize = 1234 + /** + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + */ + // const pageToken = 'abc123' + + // Imports the Asset library + const {AssetServiceClient} = require('asset').v1p5beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callListAssets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = assetClient.listAssetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListAssets(); + // [END cloudasset_v1p5beta1_generated_AssetService_ListAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/samples/generated/v1p5beta1/snippet_metadata_google.cloud.asset.v1p5beta1.json b/owl-bot-staging/google-cloud-asset/v1p5beta1/samples/generated/v1p5beta1/snippet_metadata_google.cloud.asset.v1p5beta1.json new file mode 100644 index 00000000000..4b5be9c80cd --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/samples/generated/v1p5beta1/snippet_metadata_google.cloud.asset.v1p5beta1.json @@ -0,0 +1,75 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p5beta1", + "version": "v1p5beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1p5beta1_generated_AssetService_ListAssets_async", + "title": "AssetService listAssets Sample", + "origin": "API_DEFINITION", + "description": " Lists assets with time and resource types and returns paged results in response.", + "canonical": true, + "file": "asset_service.list_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 99, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1p5beta1.AssetService.ListAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1p5beta1.ContentType" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.asset.v1p5beta1.ListAssetsResponse", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p5beta1.AssetServiceClient" + }, + "method": { + "shortName": "ListAssets", + "fullName": "google.cloud.asset.v1p5beta1.AssetService.ListAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p5beta1.AssetService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/src/index.ts b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/index.ts new file mode 100644 index 00000000000..70dd98f4167 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 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 v1p5beta1 from './v1p5beta1'; +const AssetServiceClient = v1p5beta1.AssetServiceClient; +type AssetServiceClient = v1p5beta1.AssetServiceClient; +export {v1p5beta1, AssetServiceClient}; +export default {v1p5beta1, AssetServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_client.ts b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_client.ts new file mode 100644 index 00000000000..0f579e7a9a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_client.ts @@ -0,0 +1,730 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback, GaxCall} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1p5beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './asset_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p5beta1 + */ +export class AssetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + assetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AssetServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AssetServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'cloudasset.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && '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}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + accessLevelPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/accessLevels/{access_level}' + ), + accessPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}' + ), + servicePerimeterPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAssets: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'assets') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.asset.v1p5beta1.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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.v1p5beta1.AssetService. + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.asset.v1p5beta1.AssetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.asset.v1p5beta1.AssetService, + this._opts, this._providedCustomServicePath) 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 = + ['listAssets']; + for (const methodName of assetServiceStubMethods) { + const callPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.page[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.assetServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + + /** + * Lists assets with time and resource types and returns paged results in + * response. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), or + * "projects/[project-number]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1p5beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.asset.v1p5beta1.Asset|Asset}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAssets( + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.asset.v1p5beta1.IAsset[], + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest|null, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + ]>; + listAssets( + request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.asset.v1p5beta1.IAsset>): void; + listAssets( + request: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + callback: PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.asset.v1p5beta1.IAsset>): void; + listAssets( + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.asset.v1p5beta1.IAsset>, + callback?: PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse|null|undefined, + protos.google.cloud.asset.v1p5beta1.IAsset>): + Promise<[ + protos.google.cloud.asset.v1p5beta1.IAsset[], + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest|null, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listAssets(request, options, callback); + } + +/** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), or + * "projects/[project-number]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1p5beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.asset.v1p5beta1.Asset|Asset} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAssetsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listAssetsStream( + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.createStream( + this.innerApiCalls.listAssets as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAssets`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Name of the organization or project the assets belong to. Format: + * "organizations/[organization-number]" (such as "organizations/123"), + * "projects/[project-id]" (such as "projects/my-project-id"), or + * "projects/[project-number]" (such as "projects/12345"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expression is also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1p5beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will + * be returned. + * @param {number} request.pageSize + * The maximum number of assets to be returned in a single response. Default + * is 100, minimum is 1, and maximum is 1000. + * @param {string} request.pageToken + * The `next_page_token` returned from the previous `ListAssetsResponse`, or + * unspecified for the first `ListAssetsRequest`. It is a continuation of a + * prior `ListAssets` call, and the API should return the next page of assets. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.asset.v1p5beta1.Asset|Asset}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1p5beta1/asset_service.list_assets.js + * region_tag:cloudasset_v1p5beta1_generated_AssetService_ListAssets_async + */ + listAssetsAsync( + request?: protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listAssets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAssets.asyncIterate( + this.innerApiCalls['listAssets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified accessLevel resource name string. + * + * @param {string} access_policy + * @param {string} access_level + * @returns {string} Resource name string. + */ + accessLevelPath(accessPolicy:string,accessLevel:string) { + return this.pathTemplates.accessLevelPathTemplate.render({ + access_policy: accessPolicy, + access_level: accessLevel, + }); + } + + /** + * Parse the access_policy from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName).access_policy; + } + + /** + * Parse the access_level from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_level. + */ + matchAccessLevelFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName).access_level; + } + + /** + * Return a fully-qualified accessPolicy resource name string. + * + * @param {string} access_policy + * @returns {string} Resource name string. + */ + accessPolicyPath(accessPolicy:string) { + return this.pathTemplates.accessPolicyPathTemplate.render({ + access_policy: accessPolicy, + }); + } + + /** + * Parse the access_policy from AccessPolicy resource. + * + * @param {string} accessPolicyName + * A fully-qualified path representing AccessPolicy resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessPolicyName(accessPolicyName: string) { + return this.pathTemplates.accessPolicyPathTemplate.match(accessPolicyName).access_policy; + } + + /** + * Return a fully-qualified servicePerimeter resource name string. + * + * @param {string} access_policy + * @param {string} service_perimeter + * @returns {string} Resource name string. + */ + servicePerimeterPath(accessPolicy:string,servicePerimeter:string) { + return this.pathTemplates.servicePerimeterPathTemplate.render({ + access_policy: accessPolicy, + service_perimeter: servicePerimeter, + }); + } + + /** + * Parse the access_policy from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match(servicePerimeterName).access_policy; + } + + /** + * Parse the service_perimeter from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the service_perimeter. + */ + matchServicePerimeterFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match(servicePerimeterName).service_perimeter; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_client_config.json b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_client_config.json new file mode 100644 index 00000000000..1ac24652bc2 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.cloud.asset.v1p5beta1.AssetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAssets": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_proto_list.json b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..98ff312c565 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/asset_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/asset/v1p5beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p5beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" +] diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/gapic_metadata.json new file mode 100644 index 00000000000..cd06433c8d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/gapic_metadata.json @@ -0,0 +1,37 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1p5beta1", + "libraryPackage": "asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "ListAssets": { + "methods": [ + "listAssets", + "listAssetsStream", + "listAssetsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/index.ts b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/index.ts new file mode 100644 index 00000000000..f87a8e44978 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/src/v1p5beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 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/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..e5c08e896b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const asset = require('asset'); + +function main() { + const assetServiceClient = new asset.AssetServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..3dd53f91733 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AssetServiceClient} from 'asset'; + +// check that the client class type name can be used +function doStuffWithAssetServiceClient(client: AssetServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const assetServiceClient = new AssetServiceClient(); + doStuffWithAssetServiceClient(assetServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/install.ts b/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/test/gapic_asset_service_v1p5beta1.ts b/owl-bot-staging/google-cloud-asset/v1p5beta1/test/gapic_asset_service_v1p5beta1.ts new file mode 100644 index 00000000000..2f4518eec44 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/test/gapic_asset_service_v1p5beta1.ts @@ -0,0 +1,615 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as assetserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p5beta1.AssetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = assetserviceModule.v1p5beta1.AssetServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = assetserviceModule.v1p5beta1.AssetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new assetserviceModule.v1p5beta1.AssetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = assetserviceModule.v1p5beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p5beta1.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 for the initialized client', done => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('listAssets', () => { + it('invokes listAssets without error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p5beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCall(expectedResponse); + const [response] = await client.listAssets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets without error using callback', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p5beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + ]; + client.innerApiCalls.listAssets = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAssets( + request, + (err?: Error|null, result?: protos.google.cloud.asset.v1p5beta1.IAsset[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssets with error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p5beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listAssets = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAssets(request), expectedError); + const actualRequest = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listAssetsStream without error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p5beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + ]; + client.descriptors.page.listAssets.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p5beta1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1p5beta1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert((client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listAssetsStream with error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p5beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAssetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.asset.v1p5beta1.Asset[] = []; + stream.on('data', (response: protos.google.cloud.asset.v1p5beta1.Asset) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAssets, request)); + assert( + (client.descriptors.page.listAssets.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets without error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p5beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), + ]; + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.asset.v1p5beta1.IAsset[] = []; + const iterable = client.listAssetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listAssets with error', async () => { + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p5beta1.ListAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p5beta1.ListAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAssetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.asset.v1p5beta1.IAsset[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listAssets.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('accessLevel', () => { + const fakePath = "/rendered/path/accessLevel"; + const expectedParameters = { + access_policy: "accessPolicyValue", + access_level: "accessLevelValue", + }; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessLevelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accessLevelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accessLevelPath', () => { + const result = client.accessLevelPath("accessPolicyValue", "accessLevelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accessLevelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromAccessLevelName', () => { + const result = client.matchAccessPolicyFromAccessLevelName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccessLevelFromAccessLevelName', () => { + const result = client.matchAccessLevelFromAccessLevelName(fakePath); + assert.strictEqual(result, "accessLevelValue"); + assert((client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('accessPolicy', () => { + const fakePath = "/rendered/path/accessPolicy"; + const expectedParameters = { + access_policy: "accessPolicyValue", + }; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accessPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accessPolicyPath', () => { + const result = client.accessPolicyPath("accessPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accessPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromAccessPolicyName', () => { + const result = client.matchAccessPolicyFromAccessPolicyName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.accessPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('servicePerimeter', () => { + const fakePath = "/rendered/path/servicePerimeter"; + const expectedParameters = { + access_policy: "accessPolicyValue", + service_perimeter: "servicePerimeterValue", + }; + const client = new assetserviceModule.v1p5beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servicePerimeterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePerimeterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePerimeterPath', () => { + const result = client.servicePerimeterPath("accessPolicyValue", "servicePerimeterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePerimeterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromServicePerimeterName', () => { + const result = client.matchAccessPolicyFromServicePerimeterName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServicePerimeterFromServicePerimeterName', () => { + const result = client.matchServicePerimeterFromServicePerimeterName(fakePath); + assert.strictEqual(result, "servicePerimeterValue"); + assert((client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/tsconfig.json b/owl-bot-staging/google-cloud-asset/v1p5beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1p5beta1/webpack.config.js b/owl-bot-staging/google-cloud-asset/v1p5beta1/webpack.config.js new file mode 100644 index 00000000000..9d42a74b844 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p5beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AssetService', + filename: './asset-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/.eslintignore b/owl-bot-staging/google-cloud-asset/v1p7beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/.eslintrc.json b/owl-bot-staging/google-cloud-asset/v1p7beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/.gitignore b/owl-bot-staging/google-cloud-asset/v1p7beta1/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +/.coverage +/coverage +/.nyc_output +/docs/ +/out/ +/build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/.jsdoc.js b/owl-bot-staging/google-cloud-asset/v1p7beta1/.jsdoc.js new file mode 100644 index 00000000000..67e8627c41b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2024 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/asset', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/.mocharc.js b/owl-bot-staging/google-cloud-asset/v1p7beta1/.mocharc.js new file mode 100644 index 00000000000..13b67c34edc --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2024 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. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/.prettierrc.js b/owl-bot-staging/google-cloud-asset/v1p7beta1/.prettierrc.js new file mode 100644 index 00000000000..9a8fd690982 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2024 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/README.md b/owl-bot-staging/google-cloud-asset/v1p7beta1/README.md new file mode 100644 index 00000000000..b35f3a5e22b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/README.md @@ -0,0 +1 @@ +Asset: Nodejs Client diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/package.json b/owl-bot-staging/google-cloud-asset/v1p7beta1/package.json new file mode 100644 index 00000000000..e478356ce8a --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/package.json @@ -0,0 +1,58 @@ +{ + "name": "@google-cloud/asset", + "version": "0.1.0", + "description": "Asset client for Node.js", + "repository": "googleapis/nodejs-asset", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google asset", + "asset", + "asset service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/ && minifyProtoJson", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^4.3.4" + }, + "devDependencies": { + "@types/mocha": "^10.0.6", + "@types/node": "^20.12.12", + "@types/sinon": "^10.0.20", + "c8": "^9.1.0", + "gapic-tools": "^0.4.2", + "gts": "5.3.0", + "jsdoc": "^4.0.3", + "jsdoc-fresh": "^3.0.0", + "jsdoc-region-tag": "^3.0.0", + "mocha": "^10.4.0", + "pack-n-play": "^2.0.3", + "sinon": "^15.2.0", + "typescript": "5.1.6" + }, + "engines": { + "node": ">=v14" + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/asset/v1p7beta1/asset_service.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/asset/v1p7beta1/asset_service.proto new file mode 100644 index 00000000000..36f440d1aa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/asset/v1p7beta1/asset_service.proto @@ -0,0 +1,312 @@ +// Copyright 2024 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.v1p7beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P7Beta1"; +option go_package = "cloud.google.com/go/asset/apiv1p7beta1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p7beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p7beta1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Exports assets with time and resource types to a given Cloud Storage + // location/BigQuery table. For Cloud Storage location destinations, the + // output format is newline-delimited JSON. Each line represents a + // [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in + // the JSON format; for BigQuery table destinations, the output table stores + // the fields in asset proto as columns. This API implements the + // [google.longrunning.Operation][google.longrunning.Operation] API , which + // allows you to keep track of the export. We recommend intervals of at least + // 2 seconds with exponential retry to poll the export operation result. For + // regular-size resource parent, the export operation usually finishes within + // 5 minutes. + rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p7beta1/{parent=*/*}:exportAssets" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1p7beta1.ExportAssetsResponse" + metadata_type: "google.cloud.asset.v1p7beta1.ExportAssetsRequest" + }; + } +} + +// Export asset request. +message ExportAssetsRequest { + // Required. The relative name of the root asset. This can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"), + // or a folder number (such as "folders/123"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between the current time and the current time minus 35 days (inclusive). + // If not specified, the current time will be used. Due to delays in resource + // data collection and indexing, there is a volatile window during which + // running the same query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types to take a snapshot for. For example: + // "compute.googleapis.com/Disk". + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + // + // If specified, only matching assets will be returned, otherwise, it will + // snapshot all asset types. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will be + // returned. + ContentType content_type = 4; + + // Required. Output configuration indicating where the results will be output + // to. + OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; + + // A list of relationship types to export, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]' + // specified relationships, or give errors if any relationship_types' + // supported types are not in [asset_types]. If not specified, it will + // snapshot all [asset_types]' supported relationships. An unspecified + // [asset_types] field means all supported asset_types. See [Introduction to + // Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + // supported asset types and relationship types. + repeated string relationship_types = 6; +} + +// The export asset response. This message is returned by the +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] +// method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field. +message ExportAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Output configuration indicating where the results were output to. + OutputConfig output_config = 2; + + // Output result indicating where the assets were exported to. For example, a + // set of actual Cloud Storage object URIs where the assets are + // exported to. The URIs can be different from what [output_config] has + // specified, as the service will split the output object into multiple ones + // once it exceeds a single Cloud Storage object limit. + OutputResult output_result = 3; +} + +// Output configuration for export assets destination. +message OutputConfig { + // Asset export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + + // Destination on BigQuery. The output table stores the fields in asset + // proto as columns in BigQuery. + BigQueryDestination bigquery_destination = 2; + } +} + +// Output result of export assets. +message OutputResult { + // Asset export result. + oneof result { + // Export result on Cloud Storage. + GcsOutputResult gcs_result = 1; + } +} + +// A Cloud Storage output result. +message GcsOutputResult { + // List of URIs of the Cloud Storage objects. Example: + // "gs://bucket_name/object_name". + repeated string uris = 1; +} + +// A Cloud Storage location. +message GcsDestination { + // Required. + oneof object_uri { + // The URI of the Cloud Storage object. It's the same URI that is used by + // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1; + + // The URI prefix of all generated Cloud Storage objects. Example: + // "gs://bucket_name/object_name_prefix". Each object URI is in format: + // "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only + // contains assets for that type. starts from 0. Example: + // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + // the first shard of output objects containing all + // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + // returned if file with the same name "gs://bucket_name/object_name_prefix" + // already exists. + string uri_prefix = 2; + } +} + +// A BigQuery destination for exporting assets to. +message BigQueryDestination { + // Required. The BigQuery dataset in format + // "projects/projectId/datasets/datasetId", to which the snapshot result + // should be exported. If this dataset does not exist, the export call returns + // an INVALID_ARGUMENT error. + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BigQuery table to which the snapshot result should be + // written. If this table does not exist, a new table with the given name + // will be created. + string table = 2 [(google.api.field_behavior) = REQUIRED]; + + // If the destination table already exists and this flag is `TRUE`, the + // table will be overwritten by the contents of assets snapshot. If the flag + // is `FALSE` or unset and the destination table already exists, the export + // call returns an INVALID_ARGUMEMT error. + bool force = 3; + + // [partition_spec] determines whether to export to partitioned table(s) and + // how to partition the data. + // + // If [partition_spec] is unset or [partition_spec.partition_key] is unset or + // `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to + // non-partitioned table(s). [force] will decide whether to overwrite existing + // table(s). + // + // If [partition_spec] is specified. First, the snapshot results will be + // written to partitioned table(s) with two additional timestamp columns, + // readTime and requestTime, one of which will be the partition key. Secondly, + // in the case when any destination table already exists, it will first try to + // update existing table's schema as necessary by appending additional + // columns. Then, if [force] is `TRUE`, the corresponding partition will be + // overwritten by the snapshot results (data in different partitions will + // remain intact); if [force] is unset or `FALSE`, it will append the data. An + // error will be returned if the schema update or data appension fails. + PartitionSpec partition_spec = 4; + + // If this flag is `TRUE`, the snapshot results will be written to one or + // multiple tables, each of which contains results of one asset type. The + // [force] and [partition_spec] fields will apply to each of them. + // + // Field [table] will be concatenated with "_" and the asset type names (see + // https://cloud.google.com/asset-inventory/docs/supported-asset-types for + // supported asset types) to construct per-asset-type table names, in which + // all non-alphanumeric characters like "." and "/" will be substituted by + // "_". Example: if field [table] is "mytable" and snapshot results + // contain "storage.googleapis.com/Bucket" assets, the corresponding table + // name will be "mytable_storage_googleapis_com_Bucket". If any of these + // tables does not exist, a new table with the concatenated name will be + // created. + // + // When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of + // each table will include RECORD-type columns mapped to the nested fields in + // the Asset.resource.data field of that asset type (up to the 15 nested level + // BigQuery supports + // (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The + // fields in >15 nested levels will be stored in JSON format string as a child + // column of its parent RECORD column. + // + // If error occurs when exporting to any table, the whole export call will + // return an error but the export results that already succeed will persist. + // Example: if exporting to table_type_A succeeds when exporting to + // table_type_B fails during one export call, the results in table_type_A will + // persist and there will not be partial results persisting in a table. + bool separate_tables_per_asset_type = 5; +} + +// Specifications of BigQuery partitioned table as export destination. +message PartitionSpec { + // This enum is used to determine the partition key column when exporting + // assets to BigQuery partitioned table(s). Note that, if the partition key is + // a timestamp column, the actual partition is based on its date value + // (expressed in UTC. see details in + // https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables). + enum PartitionKey { + // Unspecified partition key. If used, it means using non-partitioned table. + PARTITION_KEY_UNSPECIFIED = 0; + + // The time when the snapshot is taken. If specified as partition key, the + // result table(s) is partitoned by the additional timestamp column, + // readTime. If [read_time] in ExportAssetsRequest is specified, the + // readTime column's value will be the same as it. Otherwise, its value will + // be the current time that is used to take the snapshot. + READ_TIME = 1; + + // The time when the request is received and started to be processed. If + // specified as partition key, the result table(s) is partitoned by the + // requestTime column, an additional timestamp column representing when the + // request was received. + REQUEST_TIME = 2; + } + + // The partition key for BigQuery partitioned table. + PartitionKey partition_key = 1; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; + + // The organization policy set on an asset. + ORG_POLICY = 4; + + // The Access Context Manager policy set on an asset. + ACCESS_POLICY = 5; + + // The related resources. + RELATIONSHIP = 7; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/asset/v1p7beta1/assets.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/asset/v1p7beta1/assets.proto new file mode 100644 index 00000000000..dc613ef77f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/asset/v1p7beta1/assets.proto @@ -0,0 +1,232 @@ +// Copyright 2024 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.v1p7beta1; + +import "google/api/resource.proto"; +import "google/cloud/orgpolicy/v1/orgpolicy.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.V1P7Beta1"; +option go_package = "cloud.google.com/go/asset/apiv1p7beta1/assetpb;assetpb"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p7beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p7beta1"; + +// The Cloud Asset API. + +// An asset in Google Cloud. An asset can be any resource in the Google Cloud +// [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + + // The last update timestamp of an asset. update_time is updated when + // create/update/delete operation is performed. + google.protobuf.Timestamp update_time = 11; + + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // A representation of the resource. + Resource resource = 3; + + // A representation of the IAM policy set on a Google Cloud resource. + // There can be a maximum of one IAM policy set on any given resource. + // In addition, IAM policies inherit their granted access scope from any + // policies set on parent resources in the resource hierarchy. Therefore, the + // effectively policy is the union of both the policy set on this resource + // and each policy set on all of the resource's ancestry resource levels in + // the hierarchy. See + // [this topic](https://cloud.google.com/iam/help/allow-policies/inheritance) + // for more information. + google.iam.v1.Policy iam_policy = 4; + + // A representation of an [organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + // There can be more than one organization policy with different constraints + // set on a given resource. + repeated google.cloud.orgpolicy.v1.Policy org_policy = 6; + + // A representation of an [access + // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + oneof access_context_policy { + // Please also refer to the [access policy user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + + // Please also refer to the [access level user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). + google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + + // Please also refer to the [service perimeter user + // guide](https://cloud.google.com/vpc-service-controls/docs/overview). + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; + } + + // The related assets of the asset of one relationship type. + // One asset only represents one type of relationship. + RelatedAssets related_assets = 13; + + // The ancestry path of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. If the asset + // is a project, folder, or organization, the ancestry path starts from the + // asset itself. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 10; +} + +// A representation of a Google Cloud resource. +message Resource { + // The API version. Example: `v1` + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // Example: + // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. Example: + // `Project` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP `GET` request using this + // URL returns the resource itself. Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + // + // This value is unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + // + // For Google Cloud assets, this value is the parent resource defined in the + // [IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // Example: + // `//cloudresourcemanager.googleapis.com/projects/my_project_123` + // + // For third-party assets, this field may be set differently. + string parent = 5; + + // The content of the resource, in which some sensitive fields are removed + // and may not be present. + google.protobuf.Struct data = 6; + + // The location of the resource in Google Cloud, such as its zone and region. + // For more information, see https://cloud.google.com/about/locations/. + string location = 8; +} + +// The detailed related assets with the `relationship_type`. +message RelatedAssets { + // The detailed relation attributes. + RelationshipAttributes relationship_attributes = 1; + + // The peer resources of the relationship. + repeated RelatedAsset assets = 2; +} + +// The relationship attributes which include `type`, `source_resource_type`, +// `target_resource_type` and `action`. +message RelationshipAttributes { + // The unique identifier of the relationship type. Example: + // `INSTANCE_TO_INSTANCEGROUP` + string type = 4; + + // The source asset type. Example: `compute.googleapis.com/Instance` + string source_resource_type = 1; + + // The target asset type. Example: `compute.googleapis.com/Disk` + string target_resource_type = 2; + + // The detail of the relationship, e.g. `contains`, `attaches` + string action = 3; +} + +// An asset identify in Google Cloud which contains its name, type and +// ancestors. An asset can be any resource in the Google Cloud [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message RelatedAsset { + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string asset = 1 [(google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Asset" + }]; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // The ancestors of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto new file mode 100644 index 00000000000..10fe86a216e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/orgpolicy/v1/orgpolicy.proto @@ -0,0 +1,313 @@ +// Copyright 2024 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.orgpolicy.v1; + +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OrgPolicy.V1"; +option go_package = "cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb"; +option java_multiple_files = true; +option java_outer_classname = "OrgPolicyProto"; +option java_package = "com.google.cloud.orgpolicy.v1"; +option php_namespace = "Google\\Cloud\\OrgPolicy\\V1"; +option ruby_package = "Google::Cloud::OrgPolicy::V1"; + +// Defines a Cloud Organization `Policy` which is used to specify `Constraints` +// for configurations of Cloud Platform resources. +message Policy { + // Used in `policy_type` to specify how `list_policy` behaves at this + // resource. + // + // `ListPolicy` can define specific values and subtrees of Cloud Resource + // Manager resource hierarchy (`Organizations`, `Folders`, `Projects`) that + // are allowed or denied by setting the `allowed_values` and `denied_values` + // fields. This is achieved by using the `under:` and optional `is:` prefixes. + // The `under:` prefix is used to denote resource subtree values. + // The `is:` prefix is used to denote specific values, and is required only + // if the value contains a ":". Values prefixed with "is:" are treated the + // same as values with no prefix. + // Ancestry subtrees must be in one of the following formats: + // - "projects/", e.g. "projects/tokyo-rain-123" + // - "folders/", e.g. "folders/1234" + // - "organizations/", e.g. "organizations/1234" + // The `supports_under` field of the associated `Constraint` defines whether + // ancestry prefixes can be used. You can set `allowed_values` and + // `denied_values` in the same `Policy` if `all_values` is + // `ALL_VALUES_UNSPECIFIED`. `ALLOW` or `DENY` are used to allow or deny all + // values. If `all_values` is set to either `ALLOW` or `DENY`, + // `allowed_values` and `denied_values` must be unset. + message ListPolicy { + // This enum can be used to set `Policies` that apply to all possible + // configuration values rather than specific values in `allowed_values` or + // `denied_values`. + // + // Settting this to `ALLOW` will mean this `Policy` allows all values. + // Similarly, setting it to `DENY` will mean no values are allowed. If + // set to either `ALLOW` or `DENY, `allowed_values` and `denied_values` + // must be unset. Setting this to `ALL_VALUES_UNSPECIFIED` allows for + // setting `allowed_values` and `denied_values`. + enum AllValues { + // Indicates that allowed_values or denied_values must be set. + ALL_VALUES_UNSPECIFIED = 0; + + // A policy with this set allows all values. + ALLOW = 1; + + // A policy with this set denies all values. + DENY = 2; + } + + // List of values allowed at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string allowed_values = 1; + + // List of values denied at this resource. Can only be set if `all_values` + // is set to `ALL_VALUES_UNSPECIFIED`. + repeated string denied_values = 2; + + // The policy all_values state. + AllValues all_values = 3; + + // Optional. The Google Cloud Console will try to default to a configuration + // that matches the value specified in this `Policy`. If `suggested_value` + // is not set, it will inherit the value specified higher in the hierarchy, + // unless `inherit_from_parent` is `false`. + string suggested_value = 4; + + // Determines the inheritance behavior for this `Policy`. + // + // By default, a `ListPolicy` set at a resource supercedes any `Policy` set + // anywhere up the resource hierarchy. However, if `inherit_from_parent` is + // set to `true`, then the values from the effective `Policy` of the parent + // resource are inherited, meaning the values set in this `Policy` are + // added to the values inherited up the hierarchy. + // + // Setting `Policy` hierarchies that inherit both allowed values and denied + // values isn't recommended in most circumstances to keep the configuration + // simple and understandable. However, it is possible to set a `Policy` with + // `allowed_values` set that inherits a `Policy` with `denied_values` set. + // In this case, the values that are allowed must be in `allowed_values` and + // not present in `denied_values`. + // + // For example, suppose you have a `Constraint` + // `constraints/serviceuser.services`, which has a `constraint_type` of + // `list_constraint`, and with `constraint_default` set to `ALLOW`. + // Suppose that at the Organization level, a `Policy` is applied that + // restricts the allowed API activations to {`E1`, `E2`}. Then, if a + // `Policy` is applied to a project below the Organization that has + // `inherit_from_parent` set to `false` and field all_values set to DENY, + // then an attempt to activate any API will be denied. + // + // The following examples demonstrate different possible layerings for + // `projects/bar` parented by `organizations/foo`: + // + // Example 1 (no inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has `inherit_from_parent` `false` and values: + // {allowed_values: "E3" allowed_values: "E4"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E3`, and `E4`. + // + // Example 2 (inherited values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {value: "E3" value: "E4" inherit_from_parent: true} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. + // + // Example 3 (inheriting both allowed and denied values): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {denied_values: "E1"} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The value accepted at `projects/bar` is `E2`. + // + // Example 4 (RestoreDefault): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values:"E2"} + // `projects/bar` has a `Policy` with values: + // {RestoreDefault: {}} + // The accepted values at `organizations/foo` are `E1`, `E2`. + // The accepted values at `projects/bar` are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 5 (no policy inherits parent policy): + // `organizations/foo` has no `Policy` set. + // `projects/bar` has no `Policy` set. + // The accepted values at both levels are either all or none depending on + // the value of `constraint_default` (if `ALLOW`, all; if + // `DENY`, none). + // + // Example 6 (ListConstraint allowing all): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: ALLOW} + // The accepted values at `organizations/foo` are `E1`, E2`. + // Any value is accepted at `projects/bar`. + // + // Example 7 (ListConstraint allowing none): + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "E1" allowed_values: "E2"} + // `projects/bar` has a `Policy` with: + // {all: DENY} + // The accepted values at `organizations/foo` are `E1`, E2`. + // No value is accepted at `projects/bar`. + // + // Example 10 (allowed and denied subtrees of Resource Manager hierarchy): + // Given the following resource hierarchy + // O1->{F1, F2}; F1->{P1}; F2->{P2, P3}, + // `organizations/foo` has a `Policy` with values: + // {allowed_values: "under:organizations/O1"} + // `projects/bar` has a `Policy` with: + // {allowed_values: "under:projects/P3"} + // {denied_values: "under:folders/F2"} + // The accepted values at `organizations/foo` are `organizations/O1`, + // `folders/F1`, `folders/F2`, `projects/P1`, `projects/P2`, + // `projects/P3`. + // The accepted values at `projects/bar` are `organizations/O1`, + // `folders/F1`, `projects/P1`. + bool inherit_from_parent = 5; + } + + // Used in `policy_type` to specify how `boolean_policy` will behave at this + // resource. + message BooleanPolicy { + // If `true`, then the `Policy` is enforced. If `false`, then any + // configuration is acceptable. + // + // Suppose you have a `Constraint` + // `constraints/compute.disableSerialPortAccess` with `constraint_default` + // set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following + // behavior: + // - If the `Policy` at this resource has enforced set to `false`, serial + // port connection attempts will be allowed. + // - If the `Policy` at this resource has enforced set to `true`, serial + // port connection attempts will be refused. + // - If the `Policy` at this resource is `RestoreDefault`, serial port + // connection attempts will be allowed. + // - If no `Policy` is set at this resource or anywhere higher in the + // resource hierarchy, serial port connection attempts will be allowed. + // - If no `Policy` is set at this resource, but one exists higher in the + // resource hierarchy, the behavior is as if the`Policy` were set at + // this resource. + // + // The following examples demonstrate the different possible layerings: + // + // Example 1 (nearest `Constraint` wins): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has no `Policy` set. + // The constraint at `projects/bar` and `organizations/foo` will not be + // enforced. + // + // Example 2 (enforcement gets replaced): + // `organizations/foo` has a `Policy` with: + // {enforced: false} + // `projects/bar` has a `Policy` with: + // {enforced: true} + // The constraint at `organizations/foo` is not enforced. + // The constraint at `projects/bar` is enforced. + // + // Example 3 (RestoreDefault): + // `organizations/foo` has a `Policy` with: + // {enforced: true} + // `projects/bar` has a `Policy` with: + // {RestoreDefault: {}} + // The constraint at `organizations/foo` is enforced. + // The constraint at `projects/bar` is not enforced, because + // `constraint_default` for the `Constraint` is `ALLOW`. + bool enforced = 1; + } + + // Ignores policies set above this resource and restores the + // `constraint_default` enforcement behavior of the specific `Constraint` at + // this resource. + // + // Suppose that `constraint_default` is set to `ALLOW` for the + // `Constraint` `constraints/serviceuser.services`. Suppose that organization + // foo.com sets a `Policy` at their Organization resource node that restricts + // the allowed service activations to deny all service activations. They + // could then set a `Policy` with the `policy_type` `restore_default` on + // several experimental projects, restoring the `constraint_default` + // enforcement of the `Constraint` for only those projects, allowing those + // projects to have all services activated. + message RestoreDefault { + + } + + // Version of the `Policy`. Default version is 0; + int32 version = 1; + + // The name of the `Constraint` the `Policy` is configuring, for example, + // `constraints/serviceuser.services`. + // + // Immutable after creation. + string constraint = 2; + + // An opaque tag indicating the current version of the `Policy`, used for + // concurrency control. + // + // When the `Policy` is returned from either a `GetPolicy` or a + // `ListOrgPolicy` request, this `etag` indicates the version of the current + // `Policy` to use when executing a read-modify-write loop. + // + // When the `Policy` is returned from a `GetEffectivePolicy` request, the + // `etag` will be unset. + // + // When the `Policy` is used in a `SetOrgPolicy` method, use the `etag` value + // that was returned from a `GetOrgPolicy` request as part of a + // read-modify-write loop for concurrency control. Not setting the `etag`in a + // `SetOrgPolicy` request will result in an unconditional write of the + // `Policy`. + bytes etag = 3; + + // The time stamp the `Policy` was previously updated. This is set by the + // server, not specified by the caller, and represents the last time a call to + // `SetOrgPolicy` was made for that `Policy`. Any value set by the client will + // be ignored. + google.protobuf.Timestamp update_time = 4; + + // The field to populate is based on the `constraint_type` value in the + // `Constraint`. + // `list_constraint` => `list_policy` + // `boolean_constraint` => `boolean_policy` + // + // A `restore_default` message may be used with any `Constraint` type. + // + // Providing a *_policy that is incompatible with the `constraint_type` will + // result in an `invalid_argument` error. + // + // Attempting to set a `Policy` with a `policy_type` not set will result in an + // `invalid_argument` error. + oneof policy_type { + // List of values either allowed or disallowed. + ListPolicy list_policy = 5; + + // For boolean `Constraints`, whether to enforce the `Constraint` or not. + BooleanPolicy boolean_policy = 6; + + // Restores the default behavior of the constraint; independent of + // `Constraint` type. + RestoreDefault restore_default = 7; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/inventory.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/inventory.proto new file mode 100644 index 00000000000..96e0b23f880 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/inventory.proto @@ -0,0 +1,384 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/date.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "Inventories"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS Config Inventory is a service for collecting and reporting operating +// system and package information on VM instances. + +// This API resource represents the available inventory data for a +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// You can use this API resource to determine the inventory data of your VM. +// +// For more information, see [Information provided by OS inventory +// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). +message Inventory { + option (google.api.resource) = { + type: "osconfig.googleapis.com/Inventory" + pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory" + }; + + // Operating system information for the VM. + message OsInfo { + // The VM hostname. + string hostname = 9; + + // The operating system long name. + // For example 'Debian GNU/Linux 9' or 'Microsoft Window Server 2019 + // Datacenter'. + string long_name = 2; + + // The operating system short name. + // For example, 'windows' or 'debian'. + string short_name = 3; + + // The version of the operating system. + string version = 4; + + // The system architecture of the operating system. + string architecture = 5; + + // The kernel version of the operating system. + string kernel_version = 6; + + // The kernel release of the operating system. + string kernel_release = 7; + + // The current version of the OS Config agent running on the VM. + string osconfig_agent_version = 8; + } + + // A single piece of inventory on a VM. + message Item { + // The origin of a specific inventory item. + enum OriginType { + // Invalid. An origin type must be specified. + ORIGIN_TYPE_UNSPECIFIED = 0; + + // This inventory item was discovered as the result of the agent + // reporting inventory via the reporting API. + INVENTORY_REPORT = 1; + } + + // The different types of inventory that are tracked on a VM. + enum Type { + // Invalid. An type must be specified. + TYPE_UNSPECIFIED = 0; + + // This represents a package that is installed on the VM. + INSTALLED_PACKAGE = 1; + + // This represents an update that is available for a package. + AVAILABLE_PACKAGE = 2; + } + + // Identifier for this item, unique across items for this VM. + string id = 1; + + // The origin of this inventory item. + OriginType origin_type = 2; + + // When this inventory item was first detected. + google.protobuf.Timestamp create_time = 8; + + // When this inventory item was last modified. + google.protobuf.Timestamp update_time = 9; + + // The specific type of inventory, correlating to its specific details. + Type type = 5; + + // Specific details of this inventory item based on its type. + oneof details { + // Software package present on the VM instance. + SoftwarePackage installed_package = 6; + + // Software package available to be installed on the VM instance. + SoftwarePackage available_package = 7; + } + } + + // Software package information of the operating system. + message SoftwarePackage { + // Information about the different types of software packages. + oneof details { + // Yum package info. + // For details about the yum package manager, see + // https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/ch-yum. + VersionedPackage yum_package = 1; + + // Details of an APT package. + // For details about the apt package manager, see + // https://wiki.debian.org/Apt. + VersionedPackage apt_package = 2; + + // Details of a Zypper package. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + VersionedPackage zypper_package = 3; + + // Details of a Googet package. + // For details about the googet package manager, see + // https://github.com/google/googet. + VersionedPackage googet_package = 4; + + // Details of a Zypper patch. + // For details about the Zypper package manager, see + // https://en.opensuse.org/SDB:Zypper_manual. + ZypperPatch zypper_patch = 5; + + // Details of a Windows Update package. + // See https://docs.microsoft.com/en-us/windows/win32/api/_wua/ for + // information about Windows Update. + WindowsUpdatePackage wua_package = 6; + + // Details of a Windows Quick Fix engineering package. + // See + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + // for info in Windows Quick Fix Engineering. + WindowsQuickFixEngineeringPackage qfe_package = 7; + + // Details of a COS package. + VersionedPackage cos_package = 8; + + // Details of Windows Application. + WindowsApplication windows_application = 9; + } + } + + // Information related to the a standard versioned package. This includes + // package info for APT, Yum, Zypper, and Googet package managers. + message VersionedPackage { + // The name of the package. + string package_name = 4; + + // The system architecture this package is intended for. + string architecture = 2; + + // The version of the package. + string version = 3; + } + + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + + // Details related to a Windows Update package. + // Field data and names are taken from Windows Update API IUpdate Interface: + // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ + // Descriptive fields like title, and description are localized based on + // the locale of the VM being updated. + message WindowsUpdatePackage { + // Categories specified by the Windows Update. + message WindowsUpdateCategory { + // The identifier of the windows update category. + string id = 1; + + // The name of the windows update category. + string name = 2; + } + + // The localized title of the update package. + string title = 1; + + // The localized description of the update package. + string description = 2; + + // The categories that are associated with this update package. + repeated WindowsUpdateCategory categories = 3; + + // A collection of Microsoft Knowledge Base article IDs that are associated + // with the update package. + repeated string kb_article_ids = 4; + + // A hyperlink to the language-specific support information for the update. + string support_url = 11; + + // A collection of URLs that provide more information about the update + // package. + repeated string more_info_urls = 5; + + // Gets the identifier of an update package. Stays the same across + // revisions. + string update_id = 6; + + // The revision number of this update package. + int32 revision_number = 7; + + // The last published date of the update, in (UTC) date and time. + google.protobuf.Timestamp last_deployment_change_time = 10; + } + + // Information related to a Quick Fix Engineering package. + // Fields are taken from Windows QuickFixEngineering Interface and match + // the source names: + // https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-quickfixengineering + message WindowsQuickFixEngineeringPackage { + // A short textual description of the QFE update. + string caption = 1; + + // A textual description of the QFE update. + string description = 2; + + // Unique identifier associated with a particular QFE update. + string hot_fix_id = 3; + + // Date that the QFE update was installed. Mapped from installed_on field. + google.protobuf.Timestamp install_time = 5; + } + + // Contains information about a Windows application that is retrieved from the + // Windows Registry. For more information about these fields, see: + // https://docs.microsoft.com/en-us/windows/win32/msi/uninstall-registry-key + message WindowsApplication { + // The name of the application or product. + string display_name = 1; + + // The version of the product or application in string format. + string display_version = 2; + + // The name of the manufacturer for the product or application. + string publisher = 3; + + // The last time this product received service. The value of this property + // is replaced each time a patch is applied or removed from the product or + // the command-line option is used to repair the product. + google.type.Date install_date = 4; + + // The internet address for technical support. + string help_link = 5; + } + + // Output only. The `Inventory` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Base level operating system information for the VM. + OsInfo os_info = 1; + + // Inventory items related to the VM keyed by an opaque unique identifier for + // each inventory item. The identifier is unique to each distinct and + // addressable inventory item and will change, when there is a new package + // version. + map items = 2; + + // Output only. Timestamp of the last reported inventory for the VM. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting inventory data for the specified VM. +message GetInventoryRequest { + // Required. API resource name for inventory resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/inventory` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/Inventory" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; +} + +// A request message for listing inventory data for all VMs in the specified +// location. +message ListInventoriesRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; + + // The maximum number of results to return. + int32 page_size = 3; + + // A pagination token returned from a previous call to + // `ListInventories` that indicates where this listing + // should continue from. + string page_token = 4; + + // If provided, this field specifies the criteria that must be met by a + // `Inventory` API resource to be included in the response. + string filter = 5; +} + +// A response message for listing inventory data for all VMs in a specified +// location. +message ListInventoriesResponse { + // List of inventory objects. + repeated Inventory inventories = 1; + + // The pagination token to retrieve the next page of inventory objects. + string next_page_token = 2; +} + +// The view for inventory objects. +enum InventoryView { + // The default value. + // The API defaults to the BASIC view. + INVENTORY_VIEW_UNSPECIFIED = 0; + + // Returns the basic inventory information that includes `os_info`. + BASIC = 1; + + // Returns all fields. + FULL = 2; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy.proto new file mode 100644 index 00000000000..b67eb9c6f99 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy.proto @@ -0,0 +1,548 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// An OS policy defines the desired state configuration for a VM. +message OSPolicy { + // Policy mode + enum Mode { + // Invalid mode + MODE_UNSPECIFIED = 0; + + // This mode checks if the configuration resources in the policy are in + // their desired state. No actions are performed if they are not in the + // desired state. This mode is used for reporting purposes. + VALIDATION = 1; + + // This mode checks if the configuration resources in the policy are in + // their desired state, and if not, enforces the desired state. + ENFORCEMENT = 2; + } + + // Filtering criteria to select VMs based on inventory details. + message InventoryFilter { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // An OS policy resource is used to define the desired state configuration + // and provides a specific functionality like installing/removing packages, + // executing a script etc. + // + // The system ensures that resources are always in their desired state by + // taking necessary actions if they have drifted from their desired state. + message Resource { + // A remote or local file. + message File { + // Specifies a file available via some URI. + message Remote { + // Required. URI from which to fetch the object. It should contain both + // the protocol and path following the format `{protocol}://{location}`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // SHA256 checksum of the remote file. + string sha256_checksum = 2; + } + + // Specifies a file available as a Cloud Storage Object. + message Gcs { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Generation number of the Cloud Storage object. + int64 generation = 3; + } + + // A specific type of file. + oneof type { + // A generic remote file. + Remote remote = 1; + + // A Cloud Storage object. + Gcs gcs = 2; + + // A local path within the VM to use. + string local_path = 3; + } + + // Defaults to false. When false, files are subject to validations + // based on the file type: + // + // Remote: A checksum must be specified. + // Cloud Storage: An object generation number must be specified. + bool allow_insecure = 4; + } + + // A resource that manages a system package. + message PackageResource { + // The desired state that the OS Config agent maintains on the VM. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure that the package is installed. + INSTALLED = 1; + + // The agent ensures that the package is not installed and + // uninstalls it if detected. + REMOVED = 2; + } + + // A deb package file. dpkg packages only support INSTALLED state. + message Deb { + // Required. A deb package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `dpkg -i package` + // - install when true: `apt-get update && apt-get -y install + // package.deb` + bool pull_deps = 2; + } + + // A package managed by APT. + // - install: `apt-get update && apt-get -y install [name]` + // - remove: `apt-get -y remove [name]` + message APT { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An RPM package file. RPM packages only support INSTALLED state. + message RPM { + // Required. An rpm package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Whether dependencies should also be installed. + // - install when false: `rpm --upgrade --replacepkgs package.rpm` + // - install when true: `yum -y install package.rpm` or + // `zypper -y install package.rpm` + bool pull_deps = 2; + } + + // A package managed by YUM. + // - install: `yum -y install package` + // - remove: `yum -y remove package` + message YUM { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by Zypper. + // - install: `zypper -y install package` + // - remove: `zypper -y rm package` + message Zypper { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // A package managed by GooGet. + // - install: `googet -noconfirm install package` + // - remove: `googet -noconfirm remove package` + message GooGet { + // Required. Package name. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // An MSI package. MSI packages only support INSTALLED state. + message MSI { + // Required. The MSI package. + File source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Additional properties to use during installation. + // This should be in the format of Property=Setting. + // Appended to the defaults of `ACTION=INSTALL + // REBOOT=ReallySuppress`. + repeated string properties = 2; + } + + // Required. The desired state the agent should maintain for this package. + DesiredState desired_state = 1 [(google.api.field_behavior) = REQUIRED]; + + // A system package. + oneof system_package { + // A package managed by Apt. + APT apt = 2; + + // A deb package file. + Deb deb = 3; + + // A package managed by YUM. + YUM yum = 4; + + // A package managed by Zypper. + Zypper zypper = 5; + + // An rpm package file. + RPM rpm = 6; + + // A package managed by GooGet. + GooGet googet = 7; + + // An MSI package. + MSI msi = 8; + } + } + + // A resource that manages a package repository. + message RepositoryResource { + // Represents a single apt package repository. These will be added to + // a repo file that will be managed at + // `/etc/apt/sources.list.d/google_osconfig.list`. + message AptRepository { + // Type of archive. + enum ArchiveType { + // Unspecified is invalid. + ARCHIVE_TYPE_UNSPECIFIED = 0; + + // Deb indicates that the archive contains binary files. + DEB = 1; + + // Deb-src indicates that the archive contains source files. + DEB_SRC = 2; + } + + // Required. Type of archive files in this repository. + ArchiveType archive_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. URI for this repository. + string uri = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Distribution of this repository. + string distribution = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of components for this repository. Must contain at + // least one item. + repeated string components = 4 [(google.api.field_behavior) = REQUIRED]; + + // URI of the key file for this repository. The agent maintains a + // keyring at `/etc/apt/trusted.gpg.d/osconfig_agent_managed.gpg`. + string gpg_key = 5; + } + + // Represents a single yum package repository. These are added to a + // repo file that is managed at + // `/etc/yum.repos.d/google_osconfig.repo`. + message YumRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the yum config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for resource conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a single zypper package repository. These are added to a + // repo file that is managed at + // `/etc/zypp/repos.d/google_osconfig.repo`. + message ZypperRepository { + // Required. A one word, unique name for this repository. This is the + // `repo id` in the zypper config file and also the `display_name` if + // `display_name` is omitted. This id is also used as the unique + // identifier when checking for GuestPolicy conflicts. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // The display name of the repository. + string display_name = 2; + + // Required. The location of the repository directory. + string base_url = 3 [(google.api.field_behavior) = REQUIRED]; + + // URIs of GPG keys. + repeated string gpg_keys = 4; + } + + // Represents a Goo package repository. These are added to a repo file + // that is managed at + // `C:/ProgramData/GooGet/repos/google_osconfig.repo`. + message GooRepository { + // Required. The name of the repository. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The url of the repository. + string url = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // A specific type of repository. + oneof repository { + // An Apt Repository. + AptRepository apt = 1; + + // A Yum Repository. + YumRepository yum = 2; + + // A Zypper Repository. + ZypperRepository zypper = 3; + + // A Goo Repository. + GooRepository goo = 4; + } + } + + // A resource that allows executing scripts on the VM. + // + // The `ExecResource` has 2 stages: `validate` and `enforce` and both stages + // accept a script as an argument to execute. + // + // When the `ExecResource` is applied by the agent, it first executes the + // script in the `validate` stage. The `validate` stage can signal that the + // `ExecResource` is already in the desired state by returning an exit code + // of `100`. If the `ExecResource` is not in the desired state, it should + // return an exit code of `101`. Any other exit code returned by this stage + // is considered an error. + // + // If the `ExecResource` is not in the desired state based on the exit code + // from the `validate` stage, the agent proceeds to execute the script from + // the `enforce` stage. If the `ExecResource` is already in the desired + // state, the `enforce` stage will not be run. + // Similar to `validate` stage, the `enforce` stage should return an exit + // code of `100` to indicate that the resource in now in its desired state. + // Any other exit code is considered an error. + // + // NOTE: An exit code of `100` was chosen over `0` (and `101` vs `1`) to + // have an explicit indicator of `in desired state`, `not in desired state` + // and errors. Because, for example, Powershell will always return an exit + // code of `0` unless an `exit` statement is provided in the script. So, for + // reasons of consistency and being explicit, exit codes `100` and `101` + // were chosen. + message ExecResource { + // A file or script to execute. + message Exec { + // The interpreter to use. + enum Interpreter { + // Invalid value, the request will return validation error. + INTERPRETER_UNSPECIFIED = 0; + + // If an interpreter is not specified, the + // source is executed directly. This execution, without an + // interpreter, only succeeds for executables and scripts that have shebang lines. + NONE = 1; + + // Indicates that the script runs with `/bin/sh` on Linux and + // `cmd.exe` on Windows. + SHELL = 2; + + // Indicates that the script runs with PowerShell. + POWERSHELL = 3; + } + + // What to execute. + oneof source { + // A remote or local file. + File file = 1; + + // An inline script. + // The size of the script is limited to 1024 characters. + string script = 2; + } + + // Optional arguments to pass to the source during execution. + repeated string args = 3; + + // Required. The script interpreter to use. + Interpreter interpreter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Only recorded for enforce Exec. + // Path to an output file (that is created by this Exec) whose + // content will be recorded in OSPolicyResourceCompliance after a + // successful run. Absence or failure to read this file will result in + // this ExecResource being non-compliant. Output file size is limited to + // 100K bytes. + string output_file_path = 5; + } + + // Required. What to run to validate this resource is in the desired + // state. An exit code of 100 indicates "in desired state", and exit code + // of 101 indicates "not in desired state". Any other exit code indicates + // a failure running validate. + Exec validate = 1 [(google.api.field_behavior) = REQUIRED]; + + // What to run to bring this resource into the desired state. + // An exit code of 100 indicates "success", any other exit code indicates + // a failure running enforce. + Exec enforce = 2; + } + + // A resource that manages the state of a file. + message FileResource { + // Desired state of the file. + enum DesiredState { + // Unspecified is invalid. + DESIRED_STATE_UNSPECIFIED = 0; + + // Ensure file at path is present. + PRESENT = 1; + + // Ensure file at path is absent. + ABSENT = 2; + + // Ensure the contents of the file at path matches. If the file does + // not exist it will be created. + CONTENTS_MATCH = 3; + } + + // The source for the contents of the file. + oneof source { + // A remote or local source. + File file = 1; + + // A a file with this content. + // The size of the content is limited to 1024 characters. + string content = 2; + } + + // Required. The absolute path of the file within the VM. + string path = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Desired state of the file. + DesiredState state = 4 [(google.api.field_behavior) = REQUIRED]; + + // Consists of three octal digits which represent, in + // order, the permissions of the owner, group, and other users for the + // file (similarly to the numeric mode used in the linux chmod + // utility). Each digit represents a three bit number with the 4 bit + // corresponding to the read permissions, the 2 bit corresponds to the + // write bit, and the one bit corresponds to the execute permission. + // Default behavior is 755. + // + // Below are some examples of permissions and their associated values: + // read, write, and execute: 7 + // read and execute: 5 + // read and write: 6 + // read only: 4 + string permissions = 5; + } + + // Required. The id of the resource with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the OS policy. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Resource type. + oneof resource_type { + // Package resource + PackageResource pkg = 2; + + // Package repository resource + RepositoryResource repository = 3; + + // Exec resource + ExecResource exec = 4; + + // File resource + FileResource file = 5; + } + } + + // Resource groups provide a mechanism to group OS policy resources. + // + // Resource groups enable OS policy authors to create a single OS policy + // to be applied to VMs running different operating Systems. + // + // When the OS policy is applied to a target VM, the appropriate resource + // group within the OS policy is selected based on the `OSFilter` specified + // within the resource group. + message ResourceGroup { + // List of inventory filters for the resource group. + // + // The resources in this resource group are applied to the target VM if it + // satisfies at least one of the following inventory filters. + // + // For example, to apply this resource group to VMs running either `RHEL` or + // `CentOS` operating systems, specify 2 items for the list with following + // values: + // inventory_filters[0].os_short_name='rhel' and + // inventory_filters[1].os_short_name='centos' + // + // If the list is empty, this resource group will be applied to the target + // VM unconditionally. + repeated InventoryFilter inventory_filters = 1; + + // Required. List of resources configured for this resource group. + // The resources are executed in the exact order specified here. + repeated Resource resources = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The id of the OS policy with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the assignment. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Policy description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. Policy mode + Mode mode = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. List of resource groups for the policy. + // For a particular VM, resource groups are evaluated in the order specified + // and the first resource group that is applicable is selected and the rest + // are ignored. + // + // If none of the resource groups are applicable for a VM, the VM is + // considered to be non-compliant w.r.t this policy. This behavior can be + // toggled by the flag `allow_no_resource_group_match` + repeated ResourceGroup resource_groups = 4 + [(google.api.field_behavior) = REQUIRED]; + + // This flag determines the OS policy compliance status when none of the + // resource groups within the policy are applicable for a VM. Set this value + // to `true` if the policy needs to be reported as compliant even if the + // policy has nothing to validate or enforce. + bool allow_no_resource_group_match = 5; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto new file mode 100644 index 00000000000..1a290ee5eca --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto @@ -0,0 +1,296 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OSPolicyAssignmentReportsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}" +}; + +// Get a report of the OS policy assignment for a VM instance. +message GetOSPolicyAssignmentReportRequest { + // Required. API resource name for OS policy assignment report. + // + // Format: + // `/projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance_id}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + // For `{assignment_id}`, the OSPolicyAssignment id must be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + } + ]; +} + +// List the OS policy assignment reports for VM instances. +message ListOSPolicyAssignmentReportsRequest { + // Required. The parent resource name. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either `instance-name`, `instance-id`, or `-` can be + // provided. If '-' is provided, the response will include + // OSPolicyAssignmentReports for all instances in the project/location. + // For `{assignment}`, either `assignment-id` or `-` can be provided. If '-' + // is provided, the response will include OSPolicyAssignmentReports for all + // OSPolicyAssignments in the project/location. + // Either {instance} or {assignment} must be `-`. + // + // For example: + // `projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports` + // returns all reports for the instance + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports` + // returns all the reports for the given assignment across all instances. + // `projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports` + // returns all the reports for all assignments across all instances. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/InstanceOSPolicyAssignment" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // If provided, this field specifies the criteria that must be met by the + // `OSPolicyAssignmentReport` API resource that is included in the response. + string filter = 3; + + // A pagination token returned from a previous call to the + // `ListOSPolicyAssignmentReports` method that indicates where this listing + // should continue from. + string page_token = 4; +} + +// A response message for listing OS Policy assignment reports including the +// page of results and page token. +message ListOSPolicyAssignmentReportsResponse { + // List of OS policy assignment reports. + repeated OSPolicyAssignmentReport os_policy_assignment_reports = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // report objects. + string next_page_token = 2; +} + +// A report of the OS policy assignment status for a given instance. +message OSPolicyAssignmentReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignmentReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/report" + }; + + // Compliance data for an OS policy + message OSPolicyCompliance { + // Possible compliance states for an os policy. + enum ComplianceState { + // The policy is in an unknown compliance state. + // + // Refer to the field `compliance_state_reason` to learn the exact reason + // for the policy to be in this compliance state. + UNKNOWN = 0; + + // Policy is compliant. + // + // The policy is compliant if all the underlying resources are also + // compliant. + COMPLIANT = 1; + + // Policy is non-compliant. + // + // The policy is non-compliant if one or more underlying resources are + // non-compliant. + NON_COMPLIANT = 2; + } + + // Compliance data for an OS policy resource. + message OSPolicyResourceCompliance { + // Step performed by the OS Config agent for configuring an + // `OSPolicy` resource to its desired state. + message OSPolicyResourceConfigStep { + // Supported configuration step types + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Checks for resource conflicts such as schema errors. + VALIDATION = 1; + + // Checks the current status of the desired state for a resource. + DESIRED_STATE_CHECK = 2; + + // Enforces the desired state for a resource that is not in desired + // state. + DESIRED_STATE_ENFORCEMENT = 3; + + // Re-checks the status of the desired state. This check is done + // for a resource after the enforcement of all OS policies. + // + // This step is used to determine the final desired state status for + // the resource. It accounts for any resources that might have drifted + // from their desired state due to side effects from executing other + // resources. + DESIRED_STATE_CHECK_POST_ENFORCEMENT = 4; + } + + // Configuration step type. + Type type = 1; + + // An error message recorded during the execution of this step. + // Only populated if errors were encountered during this step execution. + string error_message = 2; + } + + // Possible compliance states for a resource. + enum ComplianceState { + // The resource is in an unknown compliance state. + // + // To get more details about why the policy is in this state, review + // the output of the `compliance_state_reason` field. + UNKNOWN = 0; + + // Resource is compliant. + COMPLIANT = 1; + + // Resource is non-compliant. + NON_COMPLIANT = 2; + } + + // ExecResource specific output. + message ExecResourceOutput { + // Output from enforcement phase output file (if run). + // Output size is limited to 100K bytes. + bytes enforcement_output = 2; + } + + // The ID of the OS policy resource. + string os_policy_resource_id = 1; + + // Ordered list of configuration completed by the agent for the OS policy + // resource. + repeated OSPolicyResourceConfigStep config_steps = 2; + + // The compliance state of the resource. + ComplianceState compliance_state = 3; + + // A reason for the resource to be in the given compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // The following values are supported when `compliance_state == UNKNOWN` + // + // * `execution-errors`: Errors were encountered by the agent while + // executing the resource and the compliance state couldn't be + // determined. + // * `execution-skipped-by-agent`: Resource execution was skipped by the + // agent because errors were encountered while executing prior resources + // in the OS policy. + // * `os-policy-execution-attempt-failed`: The execution of the OS policy + // containing this resource failed and the compliance state couldn't be + // determined. + string compliance_state_reason = 4; + + // Resource specific output. + oneof output { + // ExecResource specific output. + ExecResourceOutput exec_resource_output = 5; + } + } + + // The OS policy id + string os_policy_id = 1; + + // The compliance state of the OS policy. + ComplianceState compliance_state = 2; + + // The reason for the OS policy to be in an unknown compliance state. + // This field is always populated when `compliance_state` is `UNKNOWN`. + // + // If populated, the field can contain one of the following values: + // + // * `vm-not-running`: The VM was not running. + // * `os-policies-not-supported-by-agent`: The version of the OS Config + // agent running on the VM does not support running OS policies. + // * `no-agent-detected`: The OS Config agent is not detected for the VM. + // * `resource-execution-errors`: The OS Config agent encountered errors + // while executing one or more resources in the policy. See + // `os_policy_resource_compliances` for details. + // * `task-timeout`: The task sent to the agent to apply the policy timed + // out. + // * `unexpected-agent-state`: The OS Config agent did not report the final + // status of the task that attempted to apply the policy. Instead, the agent + // unexpectedly started working on a different task. This mostly happens + // when the agent or VM unexpectedly restarts while applying OS policies. + // * `internal-service-errors`: Internal service errors were encountered + // while attempting to apply the policy. + string compliance_state_reason = 3; + + // Compliance data for each resource within the policy that is applied to + // the VM. + repeated OSPolicyResourceCompliance os_policy_resource_compliances = 4; + } + + // The `OSPolicyAssignmentReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/osPolicyAssignments/{os_policy_assignment_id}/report` + string name = 1; + + // The Compute Engine VM instance name. + string instance = 2; + + // Reference to the `OSPolicyAssignment` API resource that the `OSPolicy` + // belongs to. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 3 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // Compliance data for each `OSPolicy` that is applied to the VM. + repeated OSPolicyCompliance os_policy_compliances = 4; + + // Timestamp for when the report was last generated. + google.protobuf.Timestamp update_time = 5; + + // Unique identifier of the last attempted run to apply the OS policies + // associated with this assignment on the VM. + // + // This ID is logged by the OS Config agent while applying the OS + // policies associated with this assignment on the VM. + // NOTE: If the service is unable to successfully connect to the agent for + // this run, then this id will not be available in the agent logs. + string last_run_id = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto new file mode 100644 index 00000000000..e1bfb7e1fb5 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/os_policy_assignments.proto @@ -0,0 +1,386 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/os_policy.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsPolicyAssignmentsProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// OS policy assignment is an API resource that is used to +// apply a set of OS policies to a dynamically targeted group of Compute Engine +// VM instances. +// +// An OS policy is used to define the desired state configuration for a +// Compute Engine VM instance through a set of configuration resources that +// provide capabilities such as installing or removing software packages, or +// executing a script. +// +// For more information, see [OS policy and OS policy +// assignment](https://cloud.google.com/compute/docs/os-configuration-management/working-with-os-policies). +message OSPolicyAssignment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + pattern: "projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}" + }; + + // Message representing label set. + // * A label is a key value pair set for a VM. + // * A LabelSet is a set of labels. + // * Labels within a LabelSet are ANDed. In other words, a LabelSet is + // applicable for a VM only if it matches all the labels in the + // LabelSet. + // * Example: A LabelSet with 2 labels: `env=prod` and `type=webserver` will + // only be applicable for those VMs with both labels + // present. + message LabelSet { + // Labels are identified by key/value pairs in this map. + // A VM should contain all the key/value pairs specified in this + // map to be selected. + map labels = 1; + } + + // Filters to select target VMs for an assignment. + // + // If more than one filter criteria is specified below, a VM will be selected + // if and only if it satisfies all of them. + message InstanceFilter { + // VM inventory details. + message Inventory { + // Required. The OS short name + string os_short_name = 1 [(google.api.field_behavior) = REQUIRED]; + + // The OS version + // + // Prefix matches are supported if asterisk(*) is provided as the + // last character. For example, to match all versions with a major + // version of `7`, specify the following value for this field `7.*` + // + // An empty string matches all OS versions. + string os_version = 2; + } + + // Target all VMs in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // List of label sets used for VM inclusion. + // + // If the list has more than one `LabelSet`, the VM is included if any + // of the label sets are applicable for the VM. + repeated LabelSet inclusion_labels = 2; + + // List of label sets used for VM exclusion. + // + // If the list has more than one label set, the VM is excluded if any + // of the label sets are applicable for the VM. + repeated LabelSet exclusion_labels = 3; + + // List of inventories to select VMs. + // + // A VM is selected if its inventory data matches at least one of the + // following inventories. + repeated Inventory inventories = 4; + } + + // Message to configure the rollout at the zonal level for the OS policy + // assignment. + message Rollout { + // Required. The maximum number (or percentage) of VMs per zone to disrupt + // at any given moment. + FixedOrPercent disruption_budget = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. This determines the minimum duration of time to wait after the + // configuration changes are applied through the current rollout. A + // VM continues to count towards the `disruption_budget` at least + // until this duration of time has passed after configuration changes are + // applied. + google.protobuf.Duration min_wait_duration = 2 + [(google.api.field_behavior) = REQUIRED]; + } + + // OS policy assignment rollout state + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id}` + // + // This field is ignored when you create an OS policy assignment. + string name = 1; + + // OS policy assignment description. + // Length of the description is limited to 1024 characters. + string description = 2; + + // Required. List of OS policies to be applied to the VMs. + repeated OSPolicy os_policies = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Filter to select VMs. + InstanceFilter instance_filter = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. Rollout to deploy the OS policy assignment. + // A rollout is triggered in the following situations: + // 1) OSPolicyAssignment is created. + // 2) OSPolicyAssignment is updated and the update contains changes to one of + // the following fields: + // - instance_filter + // - os_policies + // 3) OSPolicyAssignment is deleted. + Rollout rollout = 5 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The assignment revision ID + // A new revision is committed whenever a rollout is triggered for a OS policy + // assignment + string revision_id = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp revision_create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The etag for this OS policy assignment. + // If this is provided on update, it must match the server's etag. + string etag = 8; + + // Output only. OS policy assignment rollout state + RolloutState rollout_state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision has been successfully rolled out + // in this zone and new VMs will be assigned OS policies from this revision. + // + // For a given OS policy assignment, there is only one revision with a value + // of `true` for this field. + bool baseline = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that this revision deletes the OS policy assignment. + bool deleted = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates that reconciliation is in progress for the revision. + // This value is `true` when the `rollout_state` is one of: + // * IN_PROGRESS + // * CANCELLING + bool reconciling = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server generated unique id for the OS policy assignment + // resource. + string uid = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OS policy assignment operation metadata provided by OS policy assignment API +// methods that return long running operations. +message OSPolicyAssignmentOperationMetadata { + // The OS policy assignment API method. + enum APIMethod { + // Invalid value + API_METHOD_UNSPECIFIED = 0; + + // Create OS policy assignment API method + CREATE = 1; + + // Update OS policy assignment API method + UPDATE = 2; + + // Delete OS policy assignment API method + DELETE = 3; + } + + // State of the rollout + enum RolloutState { + // Invalid value + ROLLOUT_STATE_UNSPECIFIED = 0; + + // The rollout is in progress. + IN_PROGRESS = 1; + + // The rollout is being cancelled. + CANCELLING = 2; + + // The rollout is cancelled. + CANCELLED = 3; + + // The rollout has completed successfully. + SUCCEEDED = 4; + } + + // Reference to the `OSPolicyAssignment` API resource. + // + // Format: + // `projects/{project_number}/locations/{location}/osPolicyAssignments/{os_policy_assignment_id@revision_id}` + string os_policy_assignment = 1 [(google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + }]; + + // The OS policy assignment API method. + APIMethod api_method = 2; + + // State of the rollout + RolloutState rollout_state = 3; + + // Rollout start time + google.protobuf.Timestamp rollout_start_time = 4; + + // Rollout update time + google.protobuf.Timestamp rollout_update_time = 5; +} + +// A request message to create an OS policy assignment +message CreateOSPolicyAssignmentRequest { + // Required. The parent resource name in the form: + // projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The OS policy assignment to be created. + OSPolicyAssignment os_policy_assignment = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The logical name of the OS policy assignment in the project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string os_policy_assignment_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message to update an OS policy assignment +message UpdateOSPolicyAssignmentRequest { + // Required. The updated OS policy assignment. + OSPolicyAssignment os_policy_assignment = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the assignment should be + // updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message to get an OS policy assignment +message GetOSPolicyAssignmentRequest { + // Required. The resource name of OS policy assignment. + // + // Format: + // `projects/{project}/locations/{location}/osPolicyAssignments/{os_policy_assignment}@{revisionId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} + +// A request message to list OS policy assignments for a parent resource +message ListOSPolicyAssignmentsRequest { + // Required. The parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of assignments to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignments` that indicates where this listing should continue + // from. + string page_token = 3; +} + +// A response message for listing all assignments under given parent. +message ListOSPolicyAssignmentsResponse { + // The list of assignments + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignments. + string next_page_token = 2; +} + +// A request message to list revisions for a OS policy assignment +message ListOSPolicyAssignmentRevisionsRequest { + // Required. The name of the OS policy assignment to list revisions for. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; + + // The maximum number of revisions to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListOSPolicyAssignmentRevisions` that indicates where this listing should + // continue from. + string page_token = 3; +} + +// A response message for listing all revisions for a OS policy assignment. +message ListOSPolicyAssignmentRevisionsResponse { + // The OS policy assignment revisions + repeated OSPolicyAssignment os_policy_assignments = 1; + + // The pagination token to retrieve the next page of OS policy assignment + // revisions. + string next_page_token = 2; +} + +// A request message for deleting a OS policy assignment. +message DeleteOSPolicyAssignmentRequest { + // Required. The name of the OS policy assignment to be deleted + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/OSPolicyAssignment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_common.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_common.proto new file mode 100644 index 00000000000..1a6491cdd07 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_common.proto @@ -0,0 +1,38 @@ +// Copyright 2024 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.osconfig.v1; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "Common"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Message encapsulating a value that can be either absolute ("fixed") or +// relative ("percent") to a value. +message FixedOrPercent { + // Type of the value. + oneof mode { + // Specifies a fixed value. + int32 fixed = 1; + + // Specifies the relative value defined as a percentage, which will be + // multiplied by a reference value. + int32 percent = 2; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_service.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_service.proto new file mode 100644 index 00000000000..e4a5f2c5a83 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -0,0 +1,158 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_deployments.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/empty.proto"; +import "google/api/annotations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "OsConfigProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Instance" + pattern: "projects/{project}/zones/{zone}/instances/{instance}" + pattern: "projects/{project}/locations/{location}/instances/{instance}" +}; + +// OS Config API +// +// The OS Config service is a server-side component that you can use to +// manage package installations and patch jobs for virtual machine instances. +service OsConfigService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Patch VM instances by creating and running a patch job. + rpc ExecutePatchJob(ExecutePatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchJobs:execute" + body: "*" + }; + } + + // Get the patch job. This can be used to track the progress of an + // ongoing patch job or review the details of completed jobs. + rpc GetPatchJob(GetPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchJobs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Cancel a patch job. The patch job must be active. Canceled patch jobs + // cannot be restarted. + rpc CancelPatchJob(CancelPatchJobRequest) returns (PatchJob) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchJobs/*}:cancel" + body: "*" + }; + } + + // Get a list of patch jobs. + rpc ListPatchJobs(ListPatchJobsRequest) returns (ListPatchJobsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchJobs" + }; + option (google.api.method_signature) = "parent"; + } + + // Get a list of instance details for a given patch job. + rpc ListPatchJobInstanceDetails(ListPatchJobInstanceDetailsRequest) + returns (ListPatchJobInstanceDetailsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/patchJobs/*}/instanceDetails" + }; + option (google.api.method_signature) = "parent"; + } + + // Create an OS Config patch deployment. + rpc CreatePatchDeployment(CreatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/patchDeployments" + body: "patch_deployment" + }; + option (google.api.method_signature) = + "parent,patch_deployment,patch_deployment_id"; + } + + // Get an OS Config patch deployment. + rpc GetPatchDeployment(GetPatchDeploymentRequest) returns (PatchDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Get a page of OS Config patch deployments. + rpc ListPatchDeployments(ListPatchDeploymentsRequest) + returns (ListPatchDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/patchDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete an OS Config patch deployment. + rpc DeletePatchDeployment(DeletePatchDeploymentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/patchDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Update an OS Config patch deployment. + rpc UpdatePatchDeployment(UpdatePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + patch: "/v1/{patch_deployment.name=projects/*/patchDeployments/*}" + body: "patch_deployment" + }; + option (google.api.method_signature) = "patch_deployment,update_mask"; + } + + // Change state of patch deployment to "PAUSED". + // Patch deployment in paused state doesn't generate patch jobs. + rpc PausePatchDeployment(PausePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:pause" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Change state of patch deployment back to "ACTIVE". + // Patch deployment in active state continues to generate patch jobs. + rpc ResumePatchDeployment(ResumePatchDeploymentRequest) + returns (PatchDeployment) { + option (google.api.http) = { + post: "/v1/{name=projects/*/patchDeployments/*}:resume" + body: "*" + }; + option (google.api.method_signature) = "name"; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto new file mode 100644 index 00000000000..8a868362f5e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -0,0 +1,202 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/cloud/osconfig/v1/os_policy_assignment_reports.proto"; +import "google/cloud/osconfig/v1/os_policy_assignments.proto"; +import "google/cloud/osconfig/v1/vulnerability.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "OsConfigZonalServiceProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Zonal OS Config API +// +// The OS Config service is the server-side component that allows users to +// manage package installations and patch jobs for Compute Engine VM instances. +service OsConfigZonalService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Create an OS policy assignment. + // + // This method also creates the first revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc CreateOSPolicyAssignment(CreateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = + "parent,os_policy_assignment,os_policy_assignment_id"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Update an existing OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc UpdateOSPolicyAssignment(UpdateOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{os_policy_assignment.name=projects/*/locations/*/osPolicyAssignments/*}" + body: "os_policy_assignment" + }; + option (google.api.method_signature) = "os_policy_assignment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "OSPolicyAssignment" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Retrieve an existing OS policy assignment. + // + // This method always returns the latest revision. In order to retrieve a + // previous revision of the assignment, also provide the revision ID in the + // `name` parameter. + rpc GetOSPolicyAssignment(GetOSPolicyAssignmentRequest) + returns (OSPolicyAssignment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List the OS policy assignments under the parent resource. + // + // For each OS policy assignment, the latest revision is returned. + rpc ListOSPolicyAssignments(ListOSPolicyAssignmentsRequest) + returns (ListOSPolicyAssignmentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/osPolicyAssignments" + }; + option (google.api.method_signature) = "parent"; + } + + // List the OS policy assignment revisions for a given OS policy assignment. + rpc ListOSPolicyAssignmentRevisions(ListOSPolicyAssignmentRevisionsRequest) + returns (ListOSPolicyAssignmentRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}:listRevisions" + }; + option (google.api.method_signature) = "name"; + } + + // Delete the OS policy assignment. + // + // This method creates a new revision of the OS policy assignment. + // + // This method returns a long running operation (LRO) that contains the + // rollout details. The rollout can be cancelled by cancelling the LRO. + // + // If the LRO completes and is not cancelled, all revisions associated with + // the OS policy assignment are deleted. + // + // For more information, see [Method: + // projects.locations.osPolicyAssignments.operations.cancel](https://cloud.google.com/compute/docs/osconfig/rest/v1/projects.locations.osPolicyAssignments.operations/cancel). + rpc DeleteOSPolicyAssignment(DeleteOSPolicyAssignmentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/osPolicyAssignments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OSPolicyAssignmentOperationMetadata" + }; + } + + // Get the OS policy asssignment report for the specified Compute Engine VM + // instance. + rpc GetOSPolicyAssignmentReport(GetOSPolicyAssignmentReportRequest) + returns (OSPolicyAssignmentReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/osPolicyAssignments/*/report}" + }; + option (google.api.method_signature) = "name"; + } + + // List OS policy asssignment reports for all Compute Engine VM instances in + // the specified zone. + rpc ListOSPolicyAssignmentReports(ListOSPolicyAssignmentReportsRequest) + returns (ListOSPolicyAssignmentReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*/osPolicyAssignments/*}/reports" + }; + option (google.api.method_signature) = "parent"; + } + + // Get inventory data for the specified VM instance. If the VM has no + // associated inventory, the message `NOT_FOUND` is returned. + rpc GetInventory(GetInventoryRequest) returns (Inventory) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/inventory}" + }; + option (google.api.method_signature) = "name"; + } + + // List inventory data for all VM instances in the specified zone. + rpc ListInventories(ListInventoriesRequest) + returns (ListInventoriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the vulnerability report for the specified VM instance. Only VMs with + // inventory data have vulnerability reports associated with them. + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) + returns (VulnerabilityReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + }; + option (google.api.method_signature) = "name"; + } + + // List vulnerability reports for all VM instances in the specified zone. + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) + returns (ListVulnerabilityReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/patch_deployments.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/patch_deployments.proto new file mode 100644 index 00000000000..4df0e371048 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -0,0 +1,339 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/patch_jobs.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/datetime.proto"; +import "google/type/dayofweek.proto"; +import "google/type/timeofday.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "PatchDeployments"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Patch deployments are configurations that individual patch jobs use to +// complete a patch. These configurations include instance filter, package +// repository settings, and a schedule. For more information about creating and +// managing patch deployments, see [Scheduling patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/schedule-patch-jobs). +message PatchDeployment { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchDeployment" + pattern: "projects/{project}/patchDeployments/{patch_deployment}" + }; + + // Represents state of patch peployment. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // Active value means that patch deployment generates Patch Jobs. + ACTIVE = 1; + + // Paused value means that patch deployment does not generate + // Patch jobs. Requires user action to move in and out from this state. + PAUSED = 2; + } + + // Unique name for the patch deployment resource in a project. The patch + // deployment name is in the form: + // `projects/{project_id}/patchDeployments/{patch_deployment_id}`. + // This field is ignored when you create a new patch deployment. + string name = 1; + + // Optional. Description of the patch deployment. Length of the description is + // limited to 1024 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. VM instances to patch. + PatchInstanceFilter instance_filter = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Patch configuration that is applied. + PatchConfig patch_config = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Duration of the patch. After the duration ends, the patch times + // out. + google.protobuf.Duration duration = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Schedule for the patch. + oneof schedule { + // Required. Schedule a one-time execution. + OneTimeSchedule one_time_schedule = 6 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule recurring executions. + RecurringSchedule recurring_schedule = 7 + [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. Time the patch deployment was created. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time the patch deployment was last updated. Timestamp is in + // [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last time a patch job was started by this deployment. + // Timestamp is in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text + // format. + google.protobuf.Timestamp last_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Rollout strategy of the patch job. + PatchRollout rollout = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the patch deployment. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Sets the time for a one time patch deployment. Timestamp is in +// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. +message OneTimeSchedule { + // Required. The desired patch job execution time. + google.protobuf.Timestamp execute_time = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Sets the time for recurring patch deployments. +message RecurringSchedule { + // Specifies the frequency of the recurring patch deployments. + enum Frequency { + // Invalid. A frequency must be specified. + FREQUENCY_UNSPECIFIED = 0; + + // Indicates that the frequency of recurrence should be expressed in terms + // of weeks. + WEEKLY = 1; + + // Indicates that the frequency of recurrence should be expressed in terms + // of months. + MONTHLY = 2; + + // Indicates that the frequency of recurrence should be expressed in terms + // of days. + DAILY = 3; + } + + // Required. Defines the time zone that `time_of_day` is relative to. + // The rules for daylight saving time are determined by the chosen time zone. + google.type.TimeZone time_zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The time that the recurring schedule becomes effective. + // Defaults to `create_time` of the patch deployment. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The end time at which a recurring patch deployment schedule is no + // longer active. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Time of the day to run a recurring deployment. + google.type.TimeOfDay time_of_day = 4 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The frequency unit of this recurring schedule. + Frequency frequency = 5 [(google.api.field_behavior) = REQUIRED]; + + // Configurations for this recurring schedule. + // Configurations must match frequency. + oneof schedule_config { + // Required. Schedule with weekly executions. + WeeklySchedule weekly = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. Schedule with monthly executions. + MonthlySchedule monthly = 7 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The time the last patch job ran successfully. + google.protobuf.Timestamp last_execute_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the next patch job is scheduled to run. + google.protobuf.Timestamp next_execute_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a weekly schedule. +message WeeklySchedule { + // Required. Day of the week. + google.type.DayOfWeek day_of_week = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// Represents a monthly schedule. An example of a valid monthly schedule is +// "on the third Tuesday of the month" or "on the 15th of the month". +message MonthlySchedule { + // One day in a month. + oneof day_of_month { + // Required. Week day in a month. + WeekDayOfMonth week_day_of_month = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. One day of the month. 1-31 indicates the 1st to the 31st day. + // -1 indicates the last day of the month. Months without the target day + // will be skipped. For example, a schedule to run "every month on the 31st" + // will not run in February, April, June, etc. + int32 month_day = 2 [(google.api.field_behavior) = REQUIRED]; + } +} + +// Represents one week day in a month. An example is "the 4th Sunday". +message WeekDayOfMonth { + // Required. Week number in a month. 1-4 indicates the 1st to 4th week of the + // month. -1 indicates the last week of the month. + int32 week_ordinal = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Represents the number of days before or after the given week day + // of month that the patch deployment is scheduled for. For example if + // `week_ordinal` and `day_of_week` values point to the second day of the + // month and this `day_offset` value is set to `3`, the patch deployment takes + // place three days after the second Tuesday of the month. If this value is + // negative, for example -5, the patches are deployed five days before before + // the second Tuesday of the month. Allowed values are in range [-30, 30]. + int32 day_offset = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for creating a patch deployment. +message CreatePatchDeploymentRequest { + // Required. The project to apply this patch deployment to in the form + // `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. A name for the patch deployment in the project. When creating a + // name the following rules apply: + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the project. + string patch_deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The patch deployment to create. + PatchDeployment patch_deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A request message for retrieving a patch deployment. +message GetPatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for listing patch deployments. +message ListPatchDeploymentsRequest { + // Required. The resource name of the parent in the form `projects/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of patch deployments to return. Default is + // 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A pagination token returned from a previous call to + // ListPatchDeployments that indicates where this listing should continue + // from. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A response message for listing patch deployments. +message ListPatchDeploymentsResponse { + // The list of patch deployments. + repeated PatchDeployment patch_deployments = 1; + + // A pagination token that can be used to get the next page of patch + // deployments. + string next_page_token = 2; +} + +// A request message for deleting a patch deployment. +message DeletePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for updating a patch deployment. +message UpdatePatchDeploymentRequest { + // Required. The patch deployment to Update. + PatchDeployment patch_deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask that controls which fields of the patch deployment + // should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A request message for pausing a patch deployment. +message PausePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} + +// A request message for resuming a patch deployment. +message ResumePatchDeploymentRequest { + // Required. The resource name of the patch deployment in the form + // `projects/*/patchDeployments/*`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/patch_jobs.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/patch_jobs.proto new file mode 100644 index 00000000000..ee3df87406f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/patch_jobs.proto @@ -0,0 +1,742 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/osconfig_common.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_outer_classname = "PatchJobs"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// A request message to initiate patching across Compute Engine +// instances. +message ExecutePatchJobRequest { + // Required. The project in which to run this patch in the form `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Required. Instances to patch, either explicitly or filtered by some + // criteria such as zone or labels. + PatchInstanceFilter instance_filter = 7 + [(google.api.field_behavior) = REQUIRED]; + + // Patch configuration being applied. If omitted, instances are + // patched using the default configurations. + PatchConfig patch_config = 4; + + // Duration of the patch job. After the duration ends, the patch job + // times out. + google.protobuf.Duration duration = 5; + + // If this patch is a dry-run only, instances are contacted but + // will do nothing. + bool dry_run = 6; + + // Display name for this patch job. This does not have to be unique. + string display_name = 8; + + // Rollout strategy of the patch job. + PatchRollout rollout = 9; +} + +// Request to get an active or completed patch job. +message GetPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Request to list details for all instances that are part of a patch job. +message ListPatchJobInstanceDetailsRequest { + // Required. The parent for the instances are in the form of + // `projects/*/patchJobs/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; + + // The maximum number of instance details records to return. Default is 100. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // A filter expression that filters results listed in the response. This + // field supports filtering results by instance zone, name, state, or + // `failure_reason`. + string filter = 4; +} + +// A response message for listing the instances details for a patch job. +message ListPatchJobInstanceDetailsResponse { + // A list of instance status. + repeated PatchJobInstanceDetails patch_job_instance_details = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// Patch details for a VM instance. For more information about reviewing VM +// instance details, see +// [Listing all VM instance details for a specific patch +// job](https://cloud.google.com/compute/docs/os-patch-management/manage-patch-jobs#list-instance-details). +message PatchJobInstanceDetails { + // The instance name in the form `projects/*/zones/*/instances/*` + string name = 1 [(google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + }]; + + // The unique identifier for the instance. This identifier is + // defined by the server. + string instance_system_id = 2; + + // Current state of instance patch. + Instance.PatchState state = 3; + + // If the patch fails, this field provides the reason. + string failure_reason = 4; + + // The number of times the agent that the agent attempts to apply the patch. + int64 attempt_count = 5; +} + +// A request message for listing patch jobs. +message ListPatchJobsRequest { + // Required. In the form of `projects/*` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // The maximum number of instance status to return. + int32 page_size = 2; + + // A pagination token returned from a previous call + // that indicates where this listing should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by patch + // jobs to be included in the response. + // Currently, filtering is only available on the patch_deployment field. + string filter = 4; +} + +// A response message for listing patch jobs. +message ListPatchJobsResponse { + // The list of patch jobs. + repeated PatchJob patch_jobs = 1; + + // A pagination token that can be used to get the next page of results. + string next_page_token = 2; +} + +// A high level representation of a patch job that is either in progress +// or has completed. +// +// Instance details are not included in the job. To paginate through instance +// details, use ListPatchJobInstanceDetails. +// +// For more information about patch jobs, see +// [Creating patch +// jobs](https://cloud.google.com/compute/docs/os-patch-management/create-patch-job). +message PatchJob { + option (google.api.resource) = { + type: "osconfig.googleapis.com/PatchJob" + pattern: "projects/{project}/patchJobs/{patch_job}" + }; + + // Enumeration of the various states a patch job passes through as it + // executes. + enum State { + // State must be specified. + STATE_UNSPECIFIED = 0; + + // The patch job was successfully initiated. + STARTED = 1; + + // The patch job is looking up instances to run the patch on. + INSTANCE_LOOKUP = 2; + + // Instances are being patched. + PATCHING = 3; + + // Patch job completed successfully. + SUCCEEDED = 4; + + // Patch job completed but there were errors. + COMPLETED_WITH_ERRORS = 5; + + // The patch job was canceled. + CANCELED = 6; + + // The patch job timed out. + TIMED_OUT = 7; + } + + // A summary of the current patch state across all instances that this patch + // job affects. Contains counts of instances in different states. These states + // map to `InstancePatchState`. List patch job instance details to see the + // specific states of each instance. + message InstanceDetailsSummary { + // Number of instances pending patch job. + int64 pending_instance_count = 1; + + // Number of instances that are inactive. + int64 inactive_instance_count = 2; + + // Number of instances notified about patch job. + int64 notified_instance_count = 3; + + // Number of instances that have started. + int64 started_instance_count = 4; + + // Number of instances that are downloading patches. + int64 downloading_patches_instance_count = 5; + + // Number of instances that are applying patches. + int64 applying_patches_instance_count = 6; + + // Number of instances rebooting. + int64 rebooting_instance_count = 7; + + // Number of instances that have completed successfully. + int64 succeeded_instance_count = 8; + + // Number of instances that require reboot. + int64 succeeded_reboot_required_instance_count = 9; + + // Number of instances that failed. + int64 failed_instance_count = 10; + + // Number of instances that have acked and will start shortly. + int64 acked_instance_count = 11; + + // Number of instances that exceeded the time out while applying the patch. + int64 timed_out_instance_count = 12; + + // Number of instances that are running the pre-patch step. + int64 pre_patch_step_instance_count = 13; + + // Number of instances that are running the post-patch step. + int64 post_patch_step_instance_count = 14; + + // Number of instances that do not appear to be running the agent. Check to + // ensure that the agent is installed, running, and able to communicate with + // the service. + int64 no_agent_detected_instance_count = 15; + } + + // Unique identifier for this patch job in the form + // `projects/*/patchJobs/*` + string name = 1; + + // Display name for this patch job. This is not a unique identifier. + string display_name = 14; + + // Description of the patch job. Length of the description is limited + // to 1024 characters. + string description = 2; + + // Time this patch job was created. + google.protobuf.Timestamp create_time = 3; + + // Last time this patch job was updated. + google.protobuf.Timestamp update_time = 4; + + // The current state of the PatchJob. + State state = 5; + + // Instances to patch. + PatchInstanceFilter instance_filter = 13; + + // Patch configuration being applied. + PatchConfig patch_config = 7; + + // Duration of the patch job. After the duration ends, the + // patch job times out. + google.protobuf.Duration duration = 8; + + // Summary of instance details. + InstanceDetailsSummary instance_details_summary = 9; + + // If this patch job is a dry run, the agent reports that it has + // finished without running any updates on the VM instance. + bool dry_run = 10; + + // If this patch job failed, this message provides information about the + // failure. + string error_message = 11; + + // Reflects the overall progress of the patch job in the range of + // 0.0 being no progress to 100.0 being complete. + double percent_complete = 12; + + // Output only. Name of the patch deployment that created this patch job. + string patch_deployment = 15 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchDeployment" + } + ]; + + // Rollout strategy being applied. + PatchRollout rollout = 16; +} + +// Patch configuration specifications. Contains details on how to apply the +// patch(es) to a VM instance. +message PatchConfig { + // Post-patch reboot settings. + enum RebootConfig { + // The default behavior is DEFAULT. + REBOOT_CONFIG_UNSPECIFIED = 0; + + // The agent decides if a reboot is necessary by checking signals such as + // registry keys on Windows or `/var/run/reboot-required` on APT based + // systems. On RPM based systems, a set of core system package install times + // are compared with system boot time. + DEFAULT = 1; + + // Always reboot the machine after the update completes. + ALWAYS = 2; + + // Never reboot the machine after the update completes. + NEVER = 3; + } + + // Post-patch reboot settings. + RebootConfig reboot_config = 1; + + // Apt update settings. Use this setting to override the default `apt` patch + // rules. + AptSettings apt = 3; + + // Yum update settings. Use this setting to override the default `yum` patch + // rules. + YumSettings yum = 4; + + // Goo update settings. Use this setting to override the default `goo` patch + // rules. + GooSettings goo = 5; + + // Zypper update settings. Use this setting to override the default `zypper` + // patch rules. + ZypperSettings zypper = 6; + + // Windows update settings. Use this override the default windows patch rules. + WindowsUpdateSettings windows_update = 7; + + // The `ExecStep` to run before the patch update. + ExecStep pre_step = 8; + + // The `ExecStep` to run after the patch update. + ExecStep post_step = 9; + + // Allows the patch job to run on Managed instance groups (MIGs). + bool mig_instances_allowed = 10; +} + +// Namespace for instance state enums. +message Instance { + // Patch state of an instance. + enum PatchState { + // Unspecified. + PATCH_STATE_UNSPECIFIED = 0; + + // The instance is not yet notified. + PENDING = 1; + + // Instance is inactive and cannot be patched. + INACTIVE = 2; + + // The instance is notified that it should be patched. + NOTIFIED = 3; + + // The instance has started the patching process. + STARTED = 4; + + // The instance is downloading patches. + DOWNLOADING_PATCHES = 5; + + // The instance is applying patches. + APPLYING_PATCHES = 6; + + // The instance is rebooting. + REBOOTING = 7; + + // The instance has completed applying patches. + SUCCEEDED = 8; + + // The instance has completed applying patches but a reboot is required. + SUCCEEDED_REBOOT_REQUIRED = 9; + + // The instance has failed to apply the patch. + FAILED = 10; + + // The instance acked the notification and will start shortly. + ACKED = 11; + + // The instance exceeded the time out while applying the patch. + TIMED_OUT = 12; + + // The instance is running the pre-patch step. + RUNNING_PRE_PATCH_STEP = 13; + + // The instance is running the post-patch step. + RUNNING_POST_PATCH_STEP = 14; + + // The service could not detect the presence of the agent. Check to ensure + // that the agent is installed, running, and able to communicate with the + // service. + NO_AGENT_DETECTED = 15; + } +} + +// Message for canceling a patch job. +message CancelPatchJobRequest { + // Required. Name of the patch in the form `projects/*/patchJobs/*` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/PatchJob" + } + ]; +} + +// Apt patching is completed by executing `apt-get update && apt-get +// upgrade`. Additional options can be set to control how this is executed. +message AptSettings { + // Apt patch type. + enum Type { + // By default, upgrade will be performed. + TYPE_UNSPECIFIED = 0; + + // Runs `apt-get dist-upgrade`. + DIST = 1; + + // Runs `apt-get upgrade`. + UPGRADE = 2; + } + + // By changing the type to DIST, the patching is performed + // using `apt-get dist-upgrade` instead. + Type type = 1; + + // List of packages to exclude from update. These packages will be excluded + repeated string excludes = 2; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field cannot be specified with any other patch configuration + // fields. + repeated string exclusive_packages = 3; +} + +// Yum patching is performed by executing `yum update`. Additional options +// can be set to control how this is executed. +// +// Note that not all settings are supported on all platforms. +message YumSettings { + // Adds the `--security` flag to `yum update`. Not supported on + // all platforms. + bool security = 1; + + // Will cause patch to run `yum update-minimal` instead. + bool minimal = 2; + + // List of packages to exclude from update. These packages are excluded by + // using the yum `--exclude` flag. + repeated string excludes = 3; + + // An exclusive list of packages to be updated. These are the only packages + // that will be updated. If these packages are not installed, they will be + // ignored. This field must not be specified with any other patch + // configuration fields. + repeated string exclusive_packages = 4; +} + +// Googet patching is performed by running `googet update`. +message GooSettings {} + +// Zypper patching is performed by running `zypper patch`. +// See also https://en.opensuse.org/SDB:Zypper_manual. +message ZypperSettings { + // Adds the `--with-optional` flag to `zypper patch`. + bool with_optional = 1; + + // Adds the `--with-update` flag, to `zypper patch`. + bool with_update = 2; + + // Install only patches with these categories. + // Common categories include security, recommended, and feature. + repeated string categories = 3; + + // Install only patches with these severities. + // Common severities include critical, important, moderate, and low. + repeated string severities = 4; + + // List of patches to exclude from update. + repeated string excludes = 5; + + // An exclusive list of patches to be updated. These are the only patches + // that will be installed using 'zypper patch patch:' command. + // This field must not be used with any other patch configuration fields. + repeated string exclusive_patches = 6; +} + +// Windows patching is performed using the Windows Update Agent. +message WindowsUpdateSettings { + // Microsoft Windows update classifications as defined in + // [1] + // https://support.microsoft.com/en-us/help/824684/description-of-the-standard-terminology-that-is-used-to-describe-micro + enum Classification { + // Invalid. If classifications are included, they must be specified. + CLASSIFICATION_UNSPECIFIED = 0; + + // "A widely released fix for a specific problem that addresses a critical, + // non-security-related bug." [1] + CRITICAL = 1; + + // "A widely released fix for a product-specific, security-related + // vulnerability. Security vulnerabilities are rated by their severity. The + // severity rating is indicated in the Microsoft security bulletin as + // critical, important, moderate, or low." [1] + SECURITY = 2; + + // "A widely released and frequent software update that contains additions + // to a product's definition database. Definition databases are often used + // to detect objects that have specific attributes, such as malicious code, + // phishing websites, or junk mail." [1] + DEFINITION = 3; + + // "Software that controls the input and output of a device." [1] + DRIVER = 4; + + // "New product functionality that is first distributed outside the context + // of a product release and that is typically included in the next full + // product release." [1] + FEATURE_PACK = 5; + + // "A tested, cumulative set of all hotfixes, security updates, critical + // updates, and updates. Additionally, service packs may contain additional + // fixes for problems that are found internally since the release of the + // product. Service packs my also contain a limited number of + // customer-requested design changes or features." [1] + SERVICE_PACK = 6; + + // "A utility or feature that helps complete a task or set of tasks." [1] + TOOL = 7; + + // "A tested, cumulative set of hotfixes, security updates, critical + // updates, and updates that are packaged together for easy deployment. A + // rollup generally targets a specific area, such as security, or a + // component of a product, such as Internet Information Services (IIS)." [1] + UPDATE_ROLLUP = 8; + + // "A widely released fix for a specific problem. An update addresses a + // noncritical, non-security-related bug." [1] + UPDATE = 9; + } + + // Only apply updates of these windows update classifications. If empty, all + // updates are applied. + repeated Classification classifications = 1; + + // List of KBs to exclude from update. + repeated string excludes = 2; + + // An exclusive list of kbs to be updated. These are the only patches + // that will be updated. This field must not be used with other + // patch configurations. + repeated string exclusive_patches = 3; +} + +// A step that runs an executable for a PatchJob. +message ExecStep { + // The ExecStepConfig for all Linux VMs targeted by the PatchJob. + ExecStepConfig linux_exec_step_config = 1; + + // The ExecStepConfig for all Windows VMs targeted by the PatchJob. + ExecStepConfig windows_exec_step_config = 2; +} + +// Common configurations for an ExecStep. +message ExecStepConfig { + // The interpreter used to execute the a file. + enum Interpreter { + // Invalid for a Windows ExecStepConfig. For a Linux ExecStepConfig, the + // interpreter will be parsed from the shebang line of the script if + // unspecified. + INTERPRETER_UNSPECIFIED = 0; + + // Indicates that the script is run with `/bin/sh` on Linux and `cmd` + // on Windows. + SHELL = 1; + + // Indicates that the file is run with PowerShell flags + // `-NonInteractive`, `-NoProfile`, and `-ExecutionPolicy Bypass`. + POWERSHELL = 2; + } + + // Location of the executable. + oneof executable { + // An absolute path to the executable on the VM. + string local_path = 1; + + // A Cloud Storage object containing the executable. + GcsObject gcs_object = 2; + } + + // Defaults to [0]. A list of possible return values that the + // execution can return to indicate a success. + repeated int32 allowed_success_codes = 3; + + // The script interpreter to use to run the script. If no interpreter is + // specified the script will be executed directly, which will likely + // only succeed for scripts with [shebang lines] + // (https://en.wikipedia.org/wiki/Shebang_\(Unix\)). + Interpreter interpreter = 4; +} + +// Cloud Storage object representation. +message GcsObject { + // Required. Bucket of the Cloud Storage object. + string bucket = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the Cloud Storage object. + string object = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Generation number of the Cloud Storage object. This is used to + // ensure that the ExecStep specified by this PatchJob does not change. + int64 generation_number = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// A filter to target VM instances for patching. The targeted +// VMs must meet all criteria specified. So if both labels and zones are +// specified, the patch job targets only VMs with those labels and in those +// zones. +message PatchInstanceFilter { + // Targets a group of VM instances by using their [assigned + // labels](https://cloud.google.com/compute/docs/labeling-resources). Labels + // are key-value pairs. A `GroupLabel` is a combination of labels + // that is used to target VMs for a patch job. + // + // For example, a patch job can target VMs that have the following + // `GroupLabel`: `{"env":"test", "app":"web"}`. This means that the patch job + // is applied to VMs that have both the labels `env=test` and `app=web`. + message GroupLabel { + // Compute Engine instance labels that must be present for a VM + // instance to be targeted by this filter. + map labels = 1; + } + + // Target all VM instances in the project. If true, no other criteria is + // permitted. + bool all = 1; + + // Targets VM instances matching ANY of these GroupLabels. This allows + // targeting of disparate groups of VM instances. + repeated GroupLabel group_labels = 2; + + // Targets VM instances in ANY of these zones. Leave empty to target VM + // instances in any zone. + repeated string zones = 3; + + // Targets any of the VM instances specified. Instances are specified by their + // URI in the form `zones/[ZONE]/instances/[INSTANCE_NAME]`, + // `projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]`, or + // `https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE_NAME]` + repeated string instances = 4; + + // Targets VMs whose name starts with one of these prefixes. Similar to + // labels, this is another way to group VMs when targeting configs, for + // example prefix="prod-". + repeated string instance_name_prefixes = 5; +} + +// Patch rollout configuration specifications. Contains details on the +// concurrency control when applying patch(es) to all targeted VMs. +message PatchRollout { + // Type of the rollout. + enum Mode { + // Mode must be specified. + MODE_UNSPECIFIED = 0; + + // Patches are applied one zone at a time. The patch job begins in the + // region with the lowest number of targeted VMs. Within the region, + // patching begins in the zone with the lowest number of targeted VMs. If + // multiple regions (or zones within a region) have the same number of + // targeted VMs, a tie-breaker is achieved by sorting the regions or zones + // in alphabetical order. + ZONE_BY_ZONE = 1; + + // Patches are applied to VMs in all zones at the same time. + CONCURRENT_ZONES = 2; + } + + // Mode of the patch rollout. + Mode mode = 1; + + // The maximum number (or percentage) of VMs per zone to disrupt at any given + // moment. The number of VMs calculated from multiplying the percentage by the + // total number of VMs in a zone is rounded up. + // + // During patching, a VM is considered disrupted from the time the agent is + // notified to begin until patching has completed. This disruption time + // includes the time to complete reboot and any post-patch steps. + // + // A VM contributes to the disruption budget if its patching operation fails + // either when applying the patches, running pre or post patch steps, or if it + // fails to respond with a success notification before timing out. VMs that + // are not running or do not have an active agent do not count toward this + // disruption budget. + // + // For zone-by-zone rollouts, if the disruption budget in a zone is exceeded, + // the patch job stops, because continuing to the next zone requires + // completion of the patch process in the previous zone. + // + // For example, if the disruption budget has a fixed value of `10`, and 8 VMs + // fail to patch in the current zone, the patch job continues to patch 2 VMs + // at a time until the zone is completed. When that zone is completed + // successfully, patching begins with 10 VMs at a time in the next zone. If 10 + // VMs in the next zone fail to patch, the patch job stops. + FixedOrPercent disruption_budget = 2; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/vulnerability.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/vulnerability.proto new file mode 100644 index 00000000000..f586776da5f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/cloud/osconfig/v1/vulnerability.proto @@ -0,0 +1,365 @@ +// Copyright 2024 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "cloud.google.com/go/osconfig/apiv1/osconfigpb;osconfigpb"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// This API resource represents the vulnerability report for a specified +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// For more information, see [Vulnerability +// reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). +message VulnerabilityReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }; + + // A vulnerability affecting the VM instance. + message Vulnerability { + // Contains metadata information for the vulnerability. This information is + // collected from the upstream feed of the operating system. + message Details { + // A reference for this vulnerability. + message Reference { + // The url of the reference. + string url = 1; + + // The source of the reference e.g. NVD. + string source = 2; + } + + // The CVE of the vulnerability. CVE cannot be + // empty and the combination of should be unique + // across vulnerabilities for a VM. + string cve = 1; + + // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of + // 0 - 10 where 0 indicates low severity and 10 indicates high severity. + float cvss_v2_score = 2; + + // The full description of the CVSSv3 for this vulnerability from NVD. + CVSSv3 cvss_v3 = 3; + + // Assigned severity/impact ranking from the distro. + string severity = 4; + + // The note or description describing the vulnerability from the distro. + string description = 5; + + // Corresponds to the references attached to the `VulnerabilityDetails`. + repeated Reference references = 6; + } + + // OS inventory item that is affected by a vulnerability or fixed as a + // result of a vulnerability. + message Item { + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some + // operating systems, this field might be empty. + string installed_inventory_item_id = 1; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + string available_inventory_item_id = 2; + + // The recommended [CPE URI](https://cpe.mitre.org/specification/) update + // that contains a fix for this vulnerability. + string fixed_cpe_uri = 3; + + // The upstream OS patch, packages or KB that fixes the vulnerability. + string upstream_fix = 4; + } + + // Contains metadata as per the upstream feed of the operating system and + // NVD. + Details details = 1; + + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some distros, + // this field may be empty. + repeated string installed_inventory_item_ids = 2 [deprecated = true]; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + repeated string available_inventory_item_ids = 3 [deprecated = true]; + + // The timestamp for when the vulnerability was first detected. + google.protobuf.Timestamp create_time = 4; + + // The timestamp for when the vulnerability was last modified. + google.protobuf.Timestamp update_time = 5; + + // List of items affected by the vulnerability. + repeated Item items = 6; + } + + // Output only. The `vulnerabilityReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of vulnerabilities affecting the VM. + repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp for when the last vulnerability report was generated for the + // VM. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting the vulnerability report for the specified VM. +message GetVulnerabilityReportRequest { + // Required. API resource name for vulnerability resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + } + ]; +} + +// A request message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListVulnerabilityReports` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `vulnerabilityReport` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsResponse { + // List of vulnerabilityReport objects. + repeated VulnerabilityReport vulnerability_reports = 1; + + // The pagination token to retrieve the next page of vulnerabilityReports + // object. + string next_page_token = 2; +} + +// Common Vulnerability Scoring System version 3. +// For details, see https://www.first.org/cvss/specification-document +message CVSSv3 { + // This metric reflects the context by which vulnerability exploitation is + // possible. + enum AttackVector { + // Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The vulnerable component is bound to the network stack and the set of + // possible attackers extends beyond the other options listed below, up to + // and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1; + + // The vulnerable component is bound to the network stack, but the attack is + // limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2; + + // The vulnerable component is not bound to the network stack and the + // attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3; + + // The attack requires the attacker to physically touch or manipulate the + // vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4; + } + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + enum AttackComplexity { + // Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0; + + // Specialized access conditions or extenuating circumstances do not exist. + // An attacker can expect repeatable success when attacking the vulnerable + // component. + ATTACK_COMPLEXITY_LOW = 1; + + // A successful attack depends on conditions beyond the attacker's control. + // That is, a successful attack cannot be accomplished at will, but requires + // the attacker to invest in some measurable amount of effort in preparation + // or execution against the vulnerable component before a successful attack + // can be expected. + ATTACK_COMPLEXITY_HIGH = 2; + } + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + enum PrivilegesRequired { + // Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + + // The attacker is unauthorized prior to attack, and therefore does not + // require any access to settings or files of the vulnerable system to + // carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1; + + // The attacker requires privileges that provide basic user capabilities + // that could normally affect only settings and files owned by a user. + // Alternatively, an attacker with Low privileges has the ability to access + // only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2; + + // The attacker requires privileges that provide significant (e.g., + // administrative) control over the vulnerable component allowing access to + // component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3; + } + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + enum UserInteraction { + // Invalid value. + USER_INTERACTION_UNSPECIFIED = 0; + + // The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1; + + // Successful exploitation of this vulnerability requires a user to take + // some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2; + } + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + enum Scope { + // Invalid value. + SCOPE_UNSPECIFIED = 0; + + // An exploited vulnerability can only affect resources managed by the same + // security authority. + SCOPE_UNCHANGED = 1; + + // An exploited vulnerability can affect resources beyond the security scope + // managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2; + } + + // The Impact metrics capture the effects of a successfully exploited + // vulnerability on the component that suffers the worst outcome that is most + // directly and predictably associated with the attack. + enum Impact { + // Invalid value. + IMPACT_UNSPECIFIED = 0; + + // High impact. + IMPACT_HIGH = 1; + + // Low impact. + IMPACT_LOW = 2; + + // No impact. + IMPACT_NONE = 3; + } + + // The base score is a function of the base metric scores. + // https://www.first.org/cvss/specification-document#Base-Metrics + float base_score = 1; + + // The Exploitability sub-score equation is derived from the Base + // Exploitability metrics. + // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics + float exploitability_score = 2; + + // The Impact sub-score equation is derived from the Base Impact metrics. + float impact_score = 3; + + // This metric reflects the context by which vulnerability exploitation is + // possible. + AttackVector attack_vector = 5; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 6; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 7; + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + UserInteraction user_interaction = 8; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 9; + + // This metric measures the impact to the confidentiality of the information + // resources managed by a software component due to a successfully exploited + // vulnerability. + Impact confidentiality_impact = 10; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 11; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 12; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto new file mode 100644 index 00000000000..c442283b3ca --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/type/device_resources.proto @@ -0,0 +1,83 @@ +// Copyright 2024 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.identity.accesscontextmanager.type; + +option csharp_namespace = "Google.Identity.AccessContextManager.Type"; +option go_package = "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type"; +option java_package = "com.google.identity.accesscontextmanager.type"; +option java_multiple_files = true; +option java_outer_classname = "TypeProto"; +option php_namespace = "Google\\Identity\\AccessContextManager\\Type"; +option ruby_package = "Google::Identity::AccessContextManager::Type"; + +// The encryption state of the device. +enum DeviceEncryptionStatus { + // The encryption status of the device is not specified or not known. + ENCRYPTION_UNSPECIFIED = 0; + + // The device does not support encryption. + ENCRYPTION_UNSUPPORTED = 1; + + // The device supports encryption, but is currently unencrypted. + UNENCRYPTED = 2; + + // The device is encrypted. + ENCRYPTED = 3; +} + +// The operating system type of the device. +// Next id: 7 +enum OsType { + // The operating system of the device is not specified or not known. + OS_UNSPECIFIED = 0; + + // A desktop Mac operating system. + DESKTOP_MAC = 1; + + // A desktop Windows operating system. + DESKTOP_WINDOWS = 2; + + // A desktop Linux operating system. + DESKTOP_LINUX = 3; + + // A desktop ChromeOS operating system. + DESKTOP_CHROME_OS = 6; + + // An Android operating system. + ANDROID = 4; + + // An iOS operating system. + IOS = 5; +} + +// The degree to which the device is managed by the Cloud organization. +enum DeviceManagementLevel { + // The device's management level is not specified or not known. + MANAGEMENT_UNSPECIFIED = 0; + + // The device is not managed. + NONE = 1; + + // Basic management is enabled, which is generally limited to monitoring and + // wiping the corporate account. + BASIC = 2; + + // Complete device management. This includes more thorough monitoring and the + // ability to directly manage the device (such as remote wiping). This can be + // enabled through the Android Enterprise Platform. + COMPLETE = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto new file mode 100644 index 00000000000..7563f09a025 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto @@ -0,0 +1,986 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessContextManagerProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// API for setting [access levels] +// [google.identity.accesscontextmanager.v1.AccessLevel] and [service +// perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] +// for Google Cloud projects. Each organization has one [access policy] +// [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the +// [access levels] [google.identity.accesscontextmanager.v1.AccessLevel] +// and [service perimeters] +// [google.identity.accesscontextmanager.v1.ServicePerimeter]. This +// [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is +// applicable to all resources in the organization. +// AccessPolicies +service AccessContextManager { + option (google.api.default_host) = "accesscontextmanager.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all [access policies] + // [google.identity.accesscontextmanager.v1.AccessPolicy] in an + // organization. + rpc ListAccessPolicies(ListAccessPoliciesRequest) returns (ListAccessPoliciesResponse) { + option (google.api.http) = { + get: "/v1/accessPolicies" + }; + } + + // Returns an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] based on the name. + rpc GetAccessPolicy(GetAccessPolicyRequest) returns (AccessPolicy) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an access policy. This method fails if the organization already has + // an access policy. The long-running operation has a successful status + // after the access policy propagates to long-lasting storage. + // Syntactic and basic semantic errors are returned in `metadata` as a + // BadRequest proto. + rpc CreateAccessPolicy(AccessPolicy) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/accessPolicies" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "AccessPolicy" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. The + // long-running operation from this RPC has a successful status after the + // changes to the [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] propagate + // to long-lasting storage. + rpc UpdateAccessPolicy(UpdateAccessPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{policy.name=accessPolicies/*}" + body: "policy" + }; + option (google.api.method_signature) = "policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AccessPolicy" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes an [access policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] based on the + // resource name. The long-running operation has a successful status after the + // [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] + // is removed from long-lasting storage. + rpc DeleteAccessPolicy(DeleteAccessPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] for an access + // policy. + rpc ListAccessLevels(ListAccessLevelsRequest) returns (ListAccessLevelsResponse) { + option (google.api.http) = { + get: "/v1/{parent=accessPolicies/*}/accessLevels" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + // name. + rpc GetAccessLevel(GetAccessLevelRequest) returns (AccessLevel) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*/accessLevels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + // operation from this RPC has a successful status after the [access + // level] [google.identity.accesscontextmanager.v1.AccessLevel] + // propagates to long-lasting storage. If [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contain + // errors, an error response is returned for the first error encountered. + rpc CreateAccessLevel(CreateAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/accessLevels" + body: "access_level" + }; + option (google.api.method_signature) = "parent,access_level"; + option (google.longrunning.operation_info) = { + response_type: "AccessLevel" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + // operation from this RPC has a successful status after the changes to + // the [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] propagate + // to long-lasting storage. If [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contain + // errors, an error response is returned for the first error encountered. + rpc UpdateAccessLevel(UpdateAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{access_level.name=accessPolicies/*/accessLevels/*}" + body: "access_level" + }; + option (google.api.method_signature) = "access_level,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "AccessLevel" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes an [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + // name. The long-running operation from this RPC has a successful status + // after the [access level] + // [google.identity.accesscontextmanager.v1.AccessLevel] has been removed + // from long-lasting storage. + rpc DeleteAccessLevel(DeleteAccessLevelRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*/accessLevels/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Replaces all existing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] in an [access + // policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with + // the [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] provided. This + // is done atomically. The long-running operation from this RPC has a + // successful status after all replacements propagate to long-lasting + // storage. If the replacement contains errors, an error response is returned + // for the first error encountered. Upon error, the replacement is cancelled, + // and existing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] are not + // affected. The Operation.response field contains + // ReplaceAccessLevelsResponse. Removing [access levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] contained in existing + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] result in an + // error. + rpc ReplaceAccessLevels(ReplaceAccessLevelsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/accessLevels:replaceAll" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ReplaceAccessLevelsResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] for an + // access policy. + rpc ListServicePerimeters(ListServicePerimetersRequest) returns (ListServicePerimetersResponse) { + option (google.api.http) = { + get: "/v1/{parent=accessPolicies/*}/servicePerimeters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + // resource name. + rpc GetServicePerimeter(GetServicePerimeterRequest) returns (ServicePerimeter) { + option (google.api.http) = { + get: "/v1/{name=accessPolicies/*/servicePerimeters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. The + // long-running operation from this RPC has a successful status after the + // [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] + // propagates to long-lasting storage. If a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + // errors, an error response is returned for the first error encountered. + rpc CreateServicePerimeter(CreateServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters" + body: "service_perimeter" + }; + option (google.api.method_signature) = "parent,service_perimeter"; + option (google.longrunning.operation_info) = { + response_type: "ServicePerimeter" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Updates a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. The + // long-running operation from this RPC has a successful status after the + // [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] + // propagates to long-lasting storage. If a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + // errors, an error response is returned for the first error encountered. + rpc UpdateServicePerimeter(UpdateServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{service_perimeter.name=accessPolicies/*/servicePerimeters/*}" + body: "service_perimeter" + }; + option (google.api.method_signature) = "service_perimeter,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ServicePerimeter" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Deletes a [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + // resource name. The long-running operation from this RPC has a successful + // status after the [service perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] is removed from + // long-lasting storage. + rpc DeleteServicePerimeter(DeleteServicePerimeterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=accessPolicies/*/servicePerimeters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Replace all existing [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in an [access + // policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with the + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. This + // is done atomically. The long-running operation from this RPC has a + // successful status after all replacements propagate to long-lasting storage. + // Replacements containing errors result in an error response for the first + // error encountered. Upon an error, replacement are cancelled and existing + // [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] are not + // affected. The Operation.response field contains + // ReplaceServicePerimetersResponse. + rpc ReplaceServicePerimeters(ReplaceServicePerimetersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters:replaceAll" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "ReplaceServicePerimetersResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Commits the dry-run specification for all the [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in an + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + // A commit operation on a service perimeter involves copying its `spec` field + // to the `status` field of the service perimeter. Only [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] with + // `use_explicit_dry_run_spec` field set to true are affected by a commit + // operation. The long-running operation from this RPC has a successful + // status after the dry-run specifications for all the [service perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] have been + // committed. If a commit fails, it causes the long-running operation to + // return an error response and the entire commit operation is cancelled. + // When successful, the Operation.response field contains + // CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are + // cleared after a successful commit operation. + rpc CommitServicePerimeters(CommitServicePerimetersRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=accessPolicies/*}/servicePerimeters:commit" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "CommitServicePerimetersResponse" + metadata_type: "AccessContextManagerOperationMetadata" + }; + } + + // Lists all [GcpUserAccessBindings] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] for a + // Google Cloud organization. + rpc ListGcpUserAccessBindings(ListGcpUserAccessBindingsRequest) returns (ListGcpUserAccessBindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=organizations/*}/gcpUserAccessBindings" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] with + // the given name. + rpc GetGcpUserAccessBinding(GetGcpUserAccessBindingRequest) returns (GcpUserAccessBinding) { + option (google.api.http) = { + get: "/v1/{name=organizations/*/gcpUserAccessBindings/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. If the + // client specifies a [name] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.name], + // the server ignores it. Fails if a resource already exists with the same + // [group_key] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.group_key]. + // Completion of this long-running operation does not necessarily signify that + // the new binding is deployed onto all affected users, which may take more + // time. + rpc CreateGcpUserAccessBinding(CreateGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=organizations/*}/gcpUserAccessBindings" + body: "gcp_user_access_binding" + }; + option (google.api.method_signature) = "parent,gcp_user_access_binding"; + option (google.longrunning.operation_info) = { + response_type: "GcpUserAccessBinding" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Updates a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. + // Completion of this long-running operation does not necessarily signify that + // the changed binding is deployed onto all affected users, which may take + // more time. + rpc UpdateGcpUserAccessBinding(UpdateGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{gcp_user_access_binding.name=organizations/*/gcpUserAccessBindings/*}" + body: "gcp_user_access_binding" + }; + option (google.api.method_signature) = "gcp_user_access_binding,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GcpUserAccessBinding" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Deletes a [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. + // Completion of this long-running operation does not necessarily signify that + // the binding deletion is deployed onto all affected users, which may take + // more time. + rpc DeleteGcpUserAccessBinding(DeleteGcpUserAccessBindingRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=organizations/*/gcpUserAccessBindings/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "GcpUserAccessBindingOperationMetadata" + }; + } + + // Sets the IAM policy for the specified Access Context Manager + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + // This method replaces the existing IAM policy on the access policy. The IAM + // policy controls the set of users who can perform specific operations on the + // Access Context Manager [access + // policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:setIamPolicy" + body: "*" + }; + } + + // Gets the IAM policy for the specified Access Context Manager + // [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:getIamPolicy" + body: "*" + }; + } + + // Returns the IAM permissions that the caller has on the specified Access + // Context Manager resource. The resource can be an + // [AccessPolicy][google.identity.accesscontextmanager.v1.AccessPolicy], + // [AccessLevel][google.identity.accesscontextmanager.v1.AccessLevel], or + // [ServicePerimeter][google.identity.accesscontextmanager.v1.ServicePerimeter + // ]. This method does not support other resources. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=accessPolicies/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=accessPolicies/*/accessLevels/*}:testIamPermissions" + body: "*" + } + additional_bindings { + post: "/v1/{resource=accessPolicies/*/servicePerimeters/*}:testIamPermissions" + body: "*" + } + }; + } +} + +// A request to list all `AccessPolicies` for a container. +message ListAccessPoliciesRequest { + // Required. Resource name for the container to list AccessPolicy instances + // from. + // + // Format: + // `organizations/{org_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Number of AccessPolicy instances to include in the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of AccessPolicy instances. Defaults to + // the first page of results. + string page_token = 3; +} + +// A response to `ListAccessPoliciesRequest`. +message ListAccessPoliciesResponse { + // List of the AccessPolicy instances. + repeated AccessPolicy access_policies = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `AccessPolicy`. +message GetAccessPolicyRequest { + // Required. Resource name for the access policy to get. + // + // Format `accessPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + } + ]; +} + +// A request to update an `AccessPolicy`. +message UpdateAccessPolicyRequest { + // Required. The updated AccessPolicy. + AccessPolicy policy = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an `AccessPolicy`. +message DeleteAccessPolicyRequest { + // Required. Resource name for the access policy to delete. + // + // Format `accessPolicies/{policy_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + } + ]; +} + +// A request to list all `AccessLevels` in an `AccessPolicy`. +message ListAccessLevelsRequest { + // Required. Resource name for the access policy to list [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] from. + // + // Format: + // `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Number of [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] to include in + // the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + // Defaults to the first page of results. + string page_token = 3; + + // Whether to return `BasicLevels` in the Cloud Common Expression language, as + // `CustomLevels`, rather than as `BasicLevels`. Defaults to returning + // `AccessLevels` in the format they were defined. + LevelFormat access_level_format = 4; +} + +// A response to `ListAccessLevelsRequest`. +message ListAccessLevelsResponse { + // List of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + repeated AccessLevel access_levels = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `AccessLevel`. +message GetAccessLevelRequest { + // Required. Resource name for the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: + // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Whether to return `BasicLevels` in the Cloud Common Expression + // Language rather than as `BasicLevels`. Defaults to AS_DEFINED, where + // [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel] + // are returned as `BasicLevels` or `CustomLevels` based on how they were + // created. If set to CEL, all [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] are returned as + // `CustomLevels`. In the CEL case, `BasicLevels` are translated to equivalent + // `CustomLevels`. + LevelFormat access_level_format = 2; +} + +// A request to create an `AccessLevel`. +message CreateAccessLevelRequest { + // Required. Resource name for the access policy which owns this [Access + // Level] [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Required. The [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] to create. + // Syntactic correctness of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] is a + // precondition for creation. + AccessLevel access_level = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update an `AccessLevel`. +message UpdateAccessLevelRequest { + // Required. The updated [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. Syntactic + // correctness of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] is a + // precondition for creation. + AccessLevel access_level = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete an `AccessLevel`. +message DeleteAccessLevelRequest { + // Required. Resource name for the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: + // `accessPolicies/{policy_id}/accessLevels/{access_level_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; +} + +// A request to replace all existing Access Levels in an Access Policy with +// the Access Levels provided. This is done atomically. +message ReplaceAccessLevelsRequest { + // Required. Resource name for the access policy which owns these + // [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; + + // Required. The desired [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] that should + // replace all existing [Access Levels] + // [google.identity.accesscontextmanager.v1.AccessLevel] in the + // [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated AccessLevel access_levels = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // replace operation is to be performed on. If, at the time of replace, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the replace operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 4; +} + +// A response to ReplaceAccessLevelsRequest. This will be put inside of +// Operation.response field. +message ReplaceAccessLevelsResponse { + // List of the [Access Level] + // [google.identity.accesscontextmanager.v1.AccessLevel] instances. + repeated AccessLevel access_levels = 1; +} + +// A request to list all `ServicePerimeters` in an `AccessPolicy`. +message ListServicePerimetersRequest { + // Required. Resource name for the access policy to list [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] from. + // + // Format: + // `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Number of [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to include + // in the list. Default 100. + int32 page_size = 2; + + // Next page token for the next batch of [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + // Defaults to the first page of results. + string page_token = 3; +} + +// A response to `ListServicePerimetersRequest`. +message ListServicePerimetersResponse { + // List of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + repeated ServicePerimeter service_perimeters = 1; + + // The pagination token to retrieve the next page of results. If the value is + // empty, no further results remain. + string next_page_token = 2; +} + +// A request to get a particular `ServicePerimeter`. +message GetServicePerimeterRequest { + // Required. Resource name for the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: + // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; +} + +// A request to create a `ServicePerimeter`. +message CreateServicePerimeterRequest { + // Required. Resource name for the access policy which owns this [Service + // Perimeter] [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Required. The [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to create. + // Syntactic correctness of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] is a + // precondition for creation. + ServicePerimeter service_perimeter = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to update a `ServicePerimeter`. +message UpdateServicePerimeterRequest { + // Required. The updated `ServicePerimeter`. Syntactic correctness of the + // `ServicePerimeter` is a precondition for creation. + ServicePerimeter service_perimeter = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask to control which fields get updated. Must be non-empty. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A request to delete a `ServicePerimeter`. +message DeleteServicePerimeterRequest { + // Required. Resource name for the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: + // `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; +} + +// A request to replace all existing Service Perimeters in an Access Policy +// with the Service Perimeters provided. This is done atomically. +message ReplaceServicePerimetersRequest { + // Required. Resource name for the access policy which owns these + // [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Required. The desired [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] that should + // replace all existing [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in the + // [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated ServicePerimeter service_perimeters = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // replace operation is to be performed on. If, at the time of replace, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the replace operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 3; +} + +// A response to ReplaceServicePerimetersRequest. This will be put inside of +// Operation.response field. +message ReplaceServicePerimetersResponse { + // List of the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances. + repeated ServicePerimeter service_perimeters = 1; +} + +// A request to commit dry-run specs in all [Service Perimeters] +// [google.identity.accesscontextmanager.v1.ServicePerimeter] belonging to +// an [Access Policy][google.identity.accesscontextmanager.v1.AccessPolicy]. +message CommitServicePerimetersRequest { + // Required. Resource name for the parent [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] which owns all + // [Service Perimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] in scope for + // the commit operation. + // + // Format: `accessPolicies/{policy_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "accesscontextmanager.googleapis.com/ServicePerimeter" + } + ]; + + // Optional. The etag for the version of the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy] that this + // commit operation is to be performed on. If, at the time of commit, the + // etag for the Access Policy stored in Access Context Manager is different + // from the specified etag, then the commit operation will not be performed + // and the call will fail. This field is not required. If etag is not + // provided, the operation will be performed as if a valid etag is provided. + string etag = 2; +} + +// A response to CommitServicePerimetersRequest. This will be put inside of +// Operation.response field. +message CommitServicePerimetersResponse { + // List of all the [Service Perimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] instances in + // the [Access Policy] + // [google.identity.accesscontextmanager.v1.AccessPolicy]. + repeated ServicePerimeter service_perimeters = 1; +} + +// The format used in an `AccessLevel`. +enum LevelFormat { + // The format was not specified. + LEVEL_FORMAT_UNSPECIFIED = 0; + + // Uses the format the resource was defined in. BasicLevels are returned as + // BasicLevels, CustomLevels are returned as CustomLevels. + AS_DEFINED = 1; + + // Use Cloud Common Expression Language when returning the resource. Both + // BasicLevels and CustomLevels are returned as CustomLevels. + CEL = 2; +} + +// Request of [ListGcpUserAccessBindings] +// [google.identity.accesscontextmanager.v1.AccessContextManager.ListGcpUserAccessBindings]. +message ListGcpUserAccessBindingsRequest { + // Required. Example: "organizations/256" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Optional. Maximum number of items to return. The server may return fewer items. + // If left blank, the server may return any number of items. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If left blank, returns the first page. To enumerate all items, use the + // [next_page_token] + // [google.identity.accesscontextmanager.v1.ListGcpUserAccessBindingsResponse.next_page_token] + // from your previous list operation. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of [ListGcpUserAccessBindings] +// [google.identity.accesscontextmanager.v1.AccessContextManager.ListGcpUserAccessBindings]. +message ListGcpUserAccessBindingsResponse { + // [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + repeated GcpUserAccessBinding gcp_user_access_bindings = 1; + + // Token to get the next page of items. If blank, there are no more items. + string next_page_token = 2; +} + +// Request of [GetGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.GetGcpUserAccessBinding]. +message GetGcpUserAccessBindingRequest { + // Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + } + ]; +} + +// Request of [CreateGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.CreateGcpUserAccessBinding]. +message CreateGcpUserAccessBindingRequest { + // Required. Example: "organizations/256" + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Organization" + } + ]; + + // Required. [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + GcpUserAccessBinding gcp_user_access_binding = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request of [UpdateGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.UpdateGcpUserAccessBinding]. +message UpdateGcpUserAccessBindingRequest { + // Required. [GcpUserAccessBinding] + // [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] + GcpUserAccessBinding gcp_user_access_binding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only the fields specified in this mask are updated. Because name and + // group_key cannot be changed, update_mask is required and must always be: + // + // update_mask { + // paths: "access_levels" + // } + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request of [DeleteGcpUserAccessBinding] +// [google.identity.accesscontextmanager.v1.AccessContextManager.DeleteGcpUserAccessBinding]. +message DeleteGcpUserAccessBindingRequest { + // Required. Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + } + ]; +} + +// Currently, a completed operation means nothing. In the future, this metadata +// and a completed operation may indicate that the binding has taken effect and +// is affecting access decisions for all users. +message GcpUserAccessBindingOperationMetadata { + +} + +// Metadata of Access Context Manager's Long Running Operations. +message AccessContextManagerOperationMetadata { + +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto new file mode 100644 index 00000000000..204b74a8290 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_level.proto @@ -0,0 +1,192 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/identity/accesscontextmanager/type/device_resources.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/expr.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "AccessLevelProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// An `AccessLevel` is a label that can be applied to requests to Google Cloud +// services, along with a list of requirements necessary for the label to be +// applied. +message AccessLevel { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + pattern: "accessPolicies/{access_policy}/accessLevels/{access_level}" + }; + + // Required. Resource name for the Access Level. The `short_name` component + // must begin with a letter and only include alphanumeric and '_'. Format: + // `accessPolicies/{access_policy}/accessLevels/{access_level}`. The maximum + // length of the `access_level` component is 50 characters. + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `AccessLevel` and its use. Does not affect behavior. + string description = 3; + + // Required. Describes the necessary conditions for the level to apply. + oneof level { + // A `BasicLevel` composed of `Conditions`. + BasicLevel basic = 4; + + // A `CustomLevel` written in the Common Expression Language. + CustomLevel custom = 5; + } + + // Output only. Time the `AccessLevel` was created in UTC. + google.protobuf.Timestamp create_time = 6; + + // Output only. Time the `AccessLevel` was updated in UTC. + google.protobuf.Timestamp update_time = 7; +} + +// `BasicLevel` is an `AccessLevel` using a set of recommended features. +message BasicLevel { + // Options for how the `conditions` list should be combined to determine if + // this `AccessLevel` is applied. Default is AND. + enum ConditionCombiningFunction { + // All `Conditions` must be true for the `BasicLevel` to be true. + AND = 0; + + // If at least one `Condition` is true, then the `BasicLevel` is true. + OR = 1; + } + + // Required. A list of requirements for the `AccessLevel` to be granted. + repeated Condition conditions = 1; + + // How the `conditions` list should be combined to determine if a request is + // granted this `AccessLevel`. If AND is used, each `Condition` in + // `conditions` must be satisfied for the `AccessLevel` to be applied. If OR + // is used, at least one `Condition` in `conditions` must be satisfied for the + // `AccessLevel` to be applied. Default behavior is AND. + ConditionCombiningFunction combining_function = 2; +} + +// A condition necessary for an `AccessLevel` to be granted. The Condition is an +// AND over its fields. So a Condition is true if: 1) the request IP is from one +// of the listed subnetworks AND 2) the originating device complies with the +// listed device policy AND 3) all listed access levels are granted AND 4) the +// request was sent at a time allowed by the DateTimeRestriction. +message Condition { + // CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for + // a CIDR IP address block, the specified IP address portion must be properly + // truncated (i.e. all the host bits must be zero) or the input is considered + // malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is + // not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas + // "2001:db8::1/32" is not. The originating IP of a request must be in one of + // the listed subnets in order for this Condition to be true. If empty, all IP + // addresses are allowed. + repeated string ip_subnetworks = 1; + + // Device specific restrictions, all restrictions must hold for the + // Condition to be true. If not specified, all devices are allowed. + DevicePolicy device_policy = 2; + + // A list of other access levels defined in the same `Policy`, referenced by + // resource name. Referencing an `AccessLevel` which does not exist is an + // error. All access levels listed must be granted for the Condition + // to be true. Example: + // "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"` + repeated string required_access_levels = 3; + + // Whether to negate the Condition. If true, the Condition becomes a NAND over + // its non-empty fields, each field must be false for the Condition overall to + // be satisfied. Defaults to false. + bool negate = 5; + + // The request must be made by one of the provided user or service + // accounts. Groups are not supported. + // Syntax: + // `user:{emailid}` + // `serviceAccount:{emailid}` + // If not specified, a request may come from any user. + repeated string members = 6; + + // The request must originate from one of the provided countries/regions. + // Must be valid ISO 3166-1 alpha-2 codes. + repeated string regions = 7; +} + +// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language +// to represent the necessary conditions for the level to apply to a request. +// See CEL spec at: https://github.com/google/cel-spec +message CustomLevel { + // Required. A Cloud CEL expression evaluating to a boolean. + google.type.Expr expr = 1; +} + +// `DevicePolicy` specifies device specific restrictions necessary to acquire a +// given access level. A `DevicePolicy` specifies requirements for requests from +// devices to be granted access levels, it does not do any enforcement on the +// device. `DevicePolicy` acts as an AND over all specified fields, and each +// repeated field is an OR over its elements. Any unset fields are ignored. For +// example, if the proto is { os_type : DESKTOP_WINDOWS, os_type : +// DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be +// true for requests originating from encrypted Linux desktops and encrypted +// Windows desktops. +message DevicePolicy { + // Whether or not screenlock is required for the DevicePolicy to be true. + // Defaults to `false`. + bool require_screenlock = 1; + + // Allowed encryptions statuses, an empty list allows all statuses. + repeated google.identity.accesscontextmanager.type.DeviceEncryptionStatus allowed_encryption_statuses = 2; + + // Allowed OS versions, an empty list allows all types and all versions. + repeated OsConstraint os_constraints = 3; + + // Allowed device management levels, an empty list allows all management + // levels. + repeated google.identity.accesscontextmanager.type.DeviceManagementLevel allowed_device_management_levels = 6; + + // Whether the device needs to be approved by the customer admin. + bool require_admin_approval = 7; + + // Whether the device needs to be corp owned. + bool require_corp_owned = 8; +} + +// A restriction on the OS type and version of devices making requests. +message OsConstraint { + // Required. The allowed OS type. + google.identity.accesscontextmanager.type.OsType os_type = 1; + + // The minimum allowed OS version. If not set, any version of this OS + // satisfies the constraint. Format: `"major.minor.patch"`. + // Examples: `"10.5.301"`, `"9.2.1"`. + string minimum_version = 2; + + // Only allows requests from devices with a verified Chrome OS. + // Verifications includes requirements that the device is enterprise-managed, + // conformant to domain policies, and the caller has permission to call + // the API targeted by the request. + bool require_verified_chrome_os = 3; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto new file mode 100644 index 00000000000..65b574d9375 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/access_policy.proto @@ -0,0 +1,81 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "PolicyProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// `AccessPolicy` is a container for `AccessLevels` (which define the necessary +// attributes to use Google Cloud services) and `ServicePerimeters` (which +// define regions of services able to freely pass data within a perimeter). An +// access policy is globally visible within an organization, and the +// restrictions it specifies apply to all projects within an organization. +message AccessPolicy { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/AccessPolicy" + pattern: "accessPolicies/{access_policy}" + }; + + // Output only. Resource name of the `AccessPolicy`. Format: + // `accessPolicies/{access_policy}` + string name = 1; + + // Required. The parent of this `AccessPolicy` in the Cloud Resource + // Hierarchy. Currently immutable once created. Format: + // `organizations/{organization_id}` + string parent = 2; + + // Required. Human readable title. Does not affect behavior. + string title = 3; + + // The scopes of a policy define which resources an ACM policy can restrict, + // and where ACM resources can be referenced. + // For example, a policy with scopes=["folders/123"] has the following + // behavior: + // - vpcsc perimeters can only restrict projects within folders/123 + // - access levels can only be referenced by resources within folders/123. + // If empty, there are no limitations on which resources can be restricted by + // an ACM policy, and there are no limitations on where ACM resources can be + // referenced. + // Only one policy can include a given scope (attempting to create a second + // policy which includes "folders/123" will result in an error). + // Currently, scopes cannot be modified after a policy is created. + // Currently, policies can only have a single scope. + // Format: list of `folders/{folder_number}` or `projects/{project_number}` + repeated string scopes = 7; + + // Output only. Time the `AccessPolicy` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `AccessPolicy` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Output only. An opaque identifier for the current version of the + // `AccessPolicy`. This will always be a strongly validated etag, meaning that + // two Access Polices will be identical if and only if their etags are + // identical. Clients should not expect this to be in any specific format. + string etag = 6; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto new file mode 100644 index 00000000000..ced18e9f9ed --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto @@ -0,0 +1,68 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "GcpUserAccessBindingProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// Restricts access to Cloud Console and Google Cloud APIs for a set of users +// using Context-Aware Access. +message GcpUserAccessBinding { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/GcpUserAccessBinding" + pattern: "organizations/{organization}/gcpUserAccessBindings/{gcp_user_access_binding}" + }; + + // Immutable. Assigned by the server during creation. The last segment has an arbitrary + // length and has only URI unreserved characters (as defined by + // [RFC 3986 Section 2.3](https://tools.ietf.org/html/rfc3986#section-2.3)). + // Should not be specified by the client during creation. + // Example: "organizations/256/gcpUserAccessBindings/b3-BhcX_Ud5N" + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Immutable. Google Group id whose members are subject to this binding's restrictions. + // See "id" in the [G Suite Directory API's Groups resource] + // (https://developers.google.com/admin-sdk/directory/v1/reference/groups#resource). + // If a group's email address/alias is changed, this resource will continue + // to point at the changed group. This field does not accept group email + // addresses or aliases. + // Example: "01d520gv4vjcrht" + string group_key = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Access level that a user must have to be granted access. Only one access + // level is supported, not multiple. This repeated field must have exactly + // one element. + // Example: "accessPolicies/9522/accessLevels/device_trusted" + repeated string access_levels = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "accesscontextmanager.googleapis.com/AccessLevel" + } + ]; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto new file mode 100644 index 00000000000..d135380e788 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto @@ -0,0 +1,472 @@ +// Copyright 2024 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.identity.accesscontextmanager.v1; + +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Identity.AccessContextManager.V1"; +option go_package = "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb"; +option java_multiple_files = true; +option java_outer_classname = "ServicePerimeterProto"; +option java_package = "com.google.identity.accesscontextmanager.v1"; +option objc_class_prefix = "GACM"; +option php_namespace = "Google\\Identity\\AccessContextManager\\V1"; +option ruby_package = "Google::Identity::AccessContextManager::V1"; + +// `ServicePerimeter` describes a set of Google Cloud resources which can freely +// import and export data amongst themselves, but not export outside of the +// `ServicePerimeter`. If a request with a source within this `ServicePerimeter` +// has a target outside of the `ServicePerimeter`, the request will be blocked. +// Otherwise the request is allowed. There are two types of Service Perimeter - +// Regular and Bridge. Regular Service Perimeters cannot overlap, a single +// Google Cloud project can only belong to a single regular Service Perimeter. +// Service Perimeter Bridges can contain only Google Cloud projects as members, +// a single Google Cloud project may belong to multiple Service Perimeter +// Bridges. +message ServicePerimeter { + option (google.api.resource) = { + type: "accesscontextmanager.googleapis.com/ServicePerimeter" + pattern: "accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}" + }; + + // Specifies the type of the Perimeter. There are two types: regular and + // bridge. Regular Service Perimeter contains resources, access levels, and + // restricted services. Every resource can be in at most ONE + // regular Service Perimeter. + // + // In addition to being in a regular service perimeter, a resource can also + // be in zero or more perimeter bridges. A perimeter bridge only contains + // resources. Cross project operations are permitted if all effected + // resources share some perimeter (whether bridge or regular). Perimeter + // Bridge does not contain access levels or services: those are governed + // entirely by the regular perimeter that resource is in. + // + // Perimeter Bridges are typically useful when building more complex toplogies + // with many independent perimeters that need to share some data with a common + // perimeter, but should not be able to share data among themselves. + enum PerimeterType { + // Regular Perimeter. + PERIMETER_TYPE_REGULAR = 0; + + // Perimeter Bridge. + PERIMETER_TYPE_BRIDGE = 1; + } + + // Required. Resource name for the ServicePerimeter. The `short_name` + // component must begin with a letter and only include alphanumeric and '_'. + // Format: + // `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}` + string name = 1; + + // Human readable title. Must be unique within the Policy. + string title = 2; + + // Description of the `ServicePerimeter` and its use. Does not affect + // behavior. + string description = 3; + + // Output only. Time the `ServicePerimeter` was created in UTC. + google.protobuf.Timestamp create_time = 4; + + // Output only. Time the `ServicePerimeter` was updated in UTC. + google.protobuf.Timestamp update_time = 5; + + // Perimeter type indicator. A single project is + // allowed to be a member of single regular perimeter, but multiple service + // perimeter bridges. A project cannot be a included in a perimeter bridge + // without being included in regular perimeter. For perimeter bridges, + // the restricted service list as well as access level lists must be + // empty. + PerimeterType perimeter_type = 6; + + // Current ServicePerimeter configuration. Specifies sets of resources, + // restricted services and access levels that determine perimeter + // content and boundaries. + ServicePerimeterConfig status = 7; + + // Proposed (or dry run) ServicePerimeter configuration. This configuration + // allows to specify and test ServicePerimeter configuration without enforcing + // actual access restrictions. Only allowed to be set when the + // "use_explicit_dry_run_spec" flag is set. + ServicePerimeterConfig spec = 8; + + // Use explicit dry run spec flag. Ordinarily, a dry-run spec implicitly + // exists for all Service Perimeters, and that spec is identical to the + // status for those Service Perimeters. When this flag is set, it inhibits the + // generation of the implicit spec, thereby allowing the user to explicitly + // provide a configuration ("spec") to use in a dry-run version of the Service + // Perimeter. This allows the user to test changes to the enforced config + // ("status") without actually enforcing them. This testing is done through + // analyzing the differences between currently enforced and suggested + // restrictions. use_explicit_dry_run_spec must bet set to True if any of the + // fields in the spec are set to non-default values. + bool use_explicit_dry_run_spec = 9; +} + +// `ServicePerimeterConfig` specifies a set of Google Cloud resources that +// describe specific Service Perimeter configuration. +message ServicePerimeterConfig { + // Specifies how APIs are allowed to communicate within the Service + // Perimeter. + message VpcAccessibleServices { + // Whether to restrict API calls within the Service Perimeter to the list of + // APIs specified in 'allowed_services'. + bool enable_restriction = 1; + + // The list of APIs usable within the Service Perimeter. Must be empty + // unless 'enable_restriction' is True. You can specify a list of individual + // services, as well as include the 'RESTRICTED-SERVICES' value, which + // automatically includes all of the services protected by the perimeter. + repeated string allowed_services = 2; + } + + // Specifies the types of identities that are allowed access in either + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] + // or [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom] + // rules. + enum IdentityType { + // No blanket identity group specified. + IDENTITY_TYPE_UNSPECIFIED = 0; + + // Authorize access from all identities outside the perimeter. + ANY_IDENTITY = 1; + + // Authorize access from all human users outside the perimeter. + ANY_USER_ACCOUNT = 2; + + // Authorize access from all service accounts outside the perimeter. + ANY_SERVICE_ACCOUNT = 3; + } + + // An allowed method or permission of a service specified in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + message MethodSelector { + // The API method name or Cloud IAM permission name to allow. + oneof kind { + // Value for `method` should be a valid method name for the corresponding + // `service_name` in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + // If `*` used as value for `method`, then ALL methods and permissions are + // allowed. + string method = 1; + + // Value for `permission` should be a valid Cloud IAM permission for the + // corresponding `service_name` in [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation]. + string permission = 2; + } + } + + // Identification for an API Operation. + message ApiOperation { + // The name of the API whose methods or permissions the [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // or [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // want to allow. A single [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // with `service_name` field set to `*` will allow all methods AND + // permissions for all services. + string service_name = 1; + + // API methods or permissions to allow. Method or permission must belong to + // the service specified by `service_name` field. A single [MethodSelector] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector] + // entry with `*` specified for the `method` field will allow all methods + // AND permissions for the service specified in `service_name`. + repeated MethodSelector method_selectors = 2; + } + + // The source that [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // authorizes access from. + message IngressSource { + // Allowed ingress source. It can be one of [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] or Google + // Cloud resource. + oneof source { + // An [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] resource + // name that allow resources within the [ServicePerimeters] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to be + // accessed from the internet. [AccessLevels] + // [google.identity.accesscontextmanager.v1.AccessLevel] listed must + // be in the same policy as this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // Referencing a nonexistent [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] will cause + // an error. If no [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `accessPolicies/MY_POLICY/accessLevels/MY_LEVEL`. If a single `*` is + // specified for `access_level`, then all [IngressSources] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource] + // will be allowed. + string access_level = 1; + + // A Google Cloud resource that is allowed to ingress the perimeter. + // Requests from these resources will be allowed to access perimeter data. + // Currently only projects are allowed. + // Format: `projects/{project_number}` + // The project may be in any Google Cloud organization, not just the + // organization that the perimeter is defined in. `*` is not allowed, the + // case of allowing all Google Cloud resources only is not supported. + string resource = 2; + } + } + + // Defines the conditions under which an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request. Conditions are based on information about the source of + // the request. The request must satisfy what is defined in `sources` AND + // identity related fields in order to match. + message IngressFrom { + // Sources that this [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // authorizes access from. + repeated IngressSource sources = 1; + + // A list of identities that are allowed access through this ingress + // policy. Should be in the format of email address. The email address + // should represent individual user or service account only. + repeated string identities = 2; + + // Specifies the type of identities that are allowed access from outside the + // perimeter. If left unspecified, then members of `identities` field will + // be allowed access. + IdentityType identity_type = 3; + } + + // Defines the conditions under which an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request. Conditions are based on information about the + // [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // intended to be performed on the target resource of the request. The request + // must satisfy what is defined in `operations` AND `resources` in order to + // match. + message IngressTo { + // A list of [ApiOperations] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // allowed to be performed by the sources specified in corresponding + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] + // in this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + repeated ApiOperation operations = 1; + + // A list of resources, currently only projects in the form + // `projects/`, protected by this [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] that are + // allowed to be accessed by sources defined in the corresponding + // [IngressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom]. + // If a single `*` is specified, then access to all resources inside the + // perimeter are allowed. + repeated string resources = 2; + } + + // Policy for ingress into [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter]. + // + // [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // match requests based on `ingress_from` and `ingress_to` stanzas. For an + // ingress policy to match, both the `ingress_from` and `ingress_to` stanzas + // must be matched. If an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // matches a request, the request is allowed through the perimeter boundary + // from outside the perimeter. + // + // For example, access from the internet can be allowed either + // based on an [AccessLevel] + // [google.identity.accesscontextmanager.v1.AccessLevel] or, for traffic + // hosted on Google Cloud, the project of the source network. For access from + // private networks, using the project of the hosting network is required. + // + // Individual ingress policies can be limited by restricting which + // services and/or actions they match using the `ingress_to` field. + message IngressPolicy { + // Defines the conditions on the source of a request causing this + // [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply. + IngressFrom ingress_from = 1; + + // Defines the conditions on the [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // and request destination that cause this [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply. + IngressTo ingress_to = 2; + } + + // Defines the conditions under which an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request. Conditions based on information about the source of the + // request. Note that if the destination of the request is also protected by a + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + // an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // which allows access in order for this request to succeed. + message EgressFrom { + // A list of identities that are allowed access through this [EgressPolicy]. + // Should be in the format of email address. The email address should + // represent individual user or service account only. + repeated string identities = 1; + + // Specifies the type of identities that are allowed access to outside the + // perimeter. If left unspecified, then members of `identities` field will + // be allowed access. + IdentityType identity_type = 2; + } + + // Defines the conditions under which an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request. Conditions are based on information about the + // [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // intended to be performed on the `resources` specified. Note that if the + // destination of the request is also protected by a [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + // [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + // an [IngressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // which allows access in order for this request to succeed. The request must + // match `operations` AND `resources` fields in order to be allowed egress out + // of the perimeter. + message EgressTo { + // A list of resources, currently only projects in the form + // `projects/`, that are allowed to be accessed by sources + // defined in the corresponding [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + // A request matches if it contains a resource in this list. If `*` is + // specified for `resources`, then this [EgressTo] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo] + // rule will authorize access to all resources outside the perimeter. + repeated string resources = 1; + + // A list of [ApiOperations] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // allowed to be performed by the sources specified in the corresponding + // [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + // A request matches if it uses an operation/service in this list. + repeated ApiOperation operations = 2; + + // A list of external resources that are allowed to be accessed. Only AWS + // and Azure resources are supported. For Amazon S3, the supported format is + // s3://BUCKET_NAME. For Azure Storage, the supported format is + // azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches + // if it contains an external resource in this list (Example: + // s3://bucket/path). Currently '*' is not allowed. + repeated string external_resources = 3; + } + + // Policy for egress from perimeter. + // + // [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // match requests based on `egress_from` and `egress_to` stanzas. For an + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to match, both `egress_from` and `egress_to` stanzas must be matched. If an + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // matches a request, the request is allowed to span the [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] boundary. + // For example, an [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // can be used to allow VMs on networks within the [ServicePerimeter] + // [google.identity.accesscontextmanager.v1.ServicePerimeter] to access a + // defined set of projects outside the perimeter in certain contexts (e.g. to + // read data from a Cloud Storage bucket or query against a BigQuery dataset). + // + // [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // are concerned with the *resources* that a request relates as well as the + // API services and API actions being used. They do not related to the + // direction of data movement. More detailed documentation for this concept + // can be found in the descriptions of [EgressFrom] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom] + // and [EgressTo] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo]. + message EgressPolicy { + // Defines conditions on the source of a request causing this [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply. + EgressFrom egress_from = 1; + + // Defines the conditions on the [ApiOperation] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + // and destination resources that cause this [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply. + EgressTo egress_to = 2; + } + + // A list of Google Cloud resources that are inside of the service perimeter. + // Currently only projects are allowed. Format: `projects/{project_number}` + repeated string resources = 1; + + // A list of `AccessLevel` resource names that allow resources within the + // `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed + // must be in the same policy as this `ServicePerimeter`. Referencing a + // nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are + // listed, resources within the perimeter can only be accessed via Google + // Cloud calls with request origins within the perimeter. Example: + // `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. + // For Service Perimeter Bridge, must be empty. + repeated string access_levels = 2; + + // Google Cloud services that are subject to the Service Perimeter + // restrictions. For example, if `storage.googleapis.com` is specified, access + // to the storage buckets inside the perimeter must meet the perimeter's + // access restrictions. + repeated string restricted_services = 4; + + // Configuration for APIs allowed within Perimeter. + VpcAccessibleServices vpc_accessible_services = 10; + + // List of [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // to apply to the perimeter. A perimeter may have multiple [IngressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy], + // each of which is evaluated separately. Access is granted if any [Ingress + // Policy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + // grants it. Must be empty for a perimeter bridge. + repeated IngressPolicy ingress_policies = 8; + + // List of [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // to apply to the perimeter. A perimeter may have multiple [EgressPolicies] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy], + // each of which is evaluated separately. Access is granted if any + // [EgressPolicy] + // [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + // grants it. Must be empty for a perimeter bridge. + repeated EgressPolicy egress_policies = 9; +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.d.ts b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.d.ts new file mode 100644 index 00000000000..8c73296755f --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.d.ts @@ -0,0 +1,13238 @@ +// Copyright 2024 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. + +import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace asset. */ + namespace asset { + + /** Namespace v1p7beta1. */ + namespace v1p7beta1 { + + /** 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 ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAssets(request: google.cloud.asset.v1p7beta1.IExportAssetsRequest, callback: google.cloud.asset.v1p7beta1.AssetService.ExportAssetsCallback): void; + + /** + * Calls ExportAssets. + * @param request ExportAssetsRequest message or plain object + * @returns Promise + */ + public exportAssets(request: google.cloud.asset.v1p7beta1.IExportAssetsRequest): Promise; + } + + namespace AssetService { + + /** + * Callback as used by {@link google.cloud.asset.v1p7beta1.AssetService|exportAssets}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAssetsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an ExportAssetsRequest. */ + interface IExportAssetsRequest { + + /** ExportAssetsRequest parent */ + parent?: (string|null); + + /** ExportAssetsRequest readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes */ + assetTypes?: (string[]|null); + + /** ExportAssetsRequest contentType */ + contentType?: (google.cloud.asset.v1p7beta1.ContentType|keyof typeof google.cloud.asset.v1p7beta1.ContentType|null); + + /** ExportAssetsRequest outputConfig */ + outputConfig?: (google.cloud.asset.v1p7beta1.IOutputConfig|null); + + /** ExportAssetsRequest relationshipTypes */ + relationshipTypes?: (string[]|null); + } + + /** Represents an ExportAssetsRequest. */ + class ExportAssetsRequest implements IExportAssetsRequest { + + /** + * Constructs a new ExportAssetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IExportAssetsRequest); + + /** ExportAssetsRequest parent. */ + public parent: string; + + /** ExportAssetsRequest readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsRequest assetTypes. */ + public assetTypes: string[]; + + /** ExportAssetsRequest contentType. */ + public contentType: (google.cloud.asset.v1p7beta1.ContentType|keyof typeof google.cloud.asset.v1p7beta1.ContentType); + + /** ExportAssetsRequest outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p7beta1.IOutputConfig|null); + + /** ExportAssetsRequest relationshipTypes. */ + public relationshipTypes: string[]; + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsRequest instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IExportAssetsRequest): google.cloud.asset.v1p7beta1.ExportAssetsRequest; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p7beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.ExportAssetsRequest.verify|verify} messages. + * @param message ExportAssetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IExportAssetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.ExportAssetsRequest; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.ExportAssetsRequest; + + /** + * Verifies an ExportAssetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.ExportAssetsRequest; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @param message ExportAssetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.ExportAssetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAssetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportAssetsResponse. */ + interface IExportAssetsResponse { + + /** ExportAssetsResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig */ + outputConfig?: (google.cloud.asset.v1p7beta1.IOutputConfig|null); + + /** ExportAssetsResponse outputResult */ + outputResult?: (google.cloud.asset.v1p7beta1.IOutputResult|null); + } + + /** Represents an ExportAssetsResponse. */ + class ExportAssetsResponse implements IExportAssetsResponse { + + /** + * Constructs a new ExportAssetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IExportAssetsResponse); + + /** ExportAssetsResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); + + /** ExportAssetsResponse outputConfig. */ + public outputConfig?: (google.cloud.asset.v1p7beta1.IOutputConfig|null); + + /** ExportAssetsResponse outputResult. */ + public outputResult?: (google.cloud.asset.v1p7beta1.IOutputResult|null); + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAssetsResponse instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IExportAssetsResponse): google.cloud.asset.v1p7beta1.ExportAssetsResponse; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p7beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.ExportAssetsResponse.verify|verify} messages. + * @param message ExportAssetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IExportAssetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.ExportAssetsResponse; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.ExportAssetsResponse; + + /** + * Verifies an ExportAssetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAssetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.ExportAssetsResponse; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @param message ExportAssetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.ExportAssetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportAssetsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.asset.v1p7beta1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination */ + bigqueryDestination?: (google.cloud.asset.v1p7beta1.IBigQueryDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.asset.v1p7beta1.IGcsDestination|null); + + /** OutputConfig bigqueryDestination. */ + public bigqueryDestination?: (google.cloud.asset.v1p7beta1.IBigQueryDestination|null); + + /** OutputConfig destination. */ + public destination?: ("gcsDestination"|"bigqueryDestination"); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IOutputConfig): google.cloud.asset.v1p7beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p7beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputResult. */ + interface IOutputResult { + + /** OutputResult gcsResult */ + gcsResult?: (google.cloud.asset.v1p7beta1.IGcsOutputResult|null); + } + + /** Represents an OutputResult. */ + class OutputResult implements IOutputResult { + + /** + * Constructs a new OutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IOutputResult); + + /** OutputResult gcsResult. */ + public gcsResult?: (google.cloud.asset.v1p7beta1.IGcsOutputResult|null); + + /** OutputResult result. */ + public result?: "gcsResult"; + + /** + * Creates a new OutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputResult instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IOutputResult): google.cloud.asset.v1p7beta1.OutputResult; + + /** + * Encodes the specified OutputResult message. Does not implicitly {@link google.cloud.asset.v1p7beta1.OutputResult.verify|verify} messages. + * @param message OutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.OutputResult.verify|verify} messages. + * @param message OutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.OutputResult; + + /** + * Decodes an OutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.OutputResult; + + /** + * Verifies an OutputResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.OutputResult; + + /** + * Creates a plain object from an OutputResult message. Also converts values to other types if specified. + * @param message OutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.OutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsOutputResult. */ + interface IGcsOutputResult { + + /** GcsOutputResult uris */ + uris?: (string[]|null); + } + + /** Represents a GcsOutputResult. */ + class GcsOutputResult implements IGcsOutputResult { + + /** + * Constructs a new GcsOutputResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IGcsOutputResult); + + /** GcsOutputResult uris. */ + public uris: string[]; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsOutputResult instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IGcsOutputResult): google.cloud.asset.v1p7beta1.GcsOutputResult; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.asset.v1p7beta1.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.GcsOutputResult.verify|verify} messages. + * @param message GcsOutputResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IGcsOutputResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.GcsOutputResult; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.GcsOutputResult; + + /** + * Verifies a GcsOutputResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsOutputResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.GcsOutputResult; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @param message GcsOutputResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.GcsOutputResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsOutputResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsOutputResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcsDestination. */ + interface IGcsDestination { + + /** GcsDestination uri */ + uri?: (string|null); + + /** GcsDestination uriPrefix */ + uriPrefix?: (string|null); + } + + /** Represents a GcsDestination. */ + class GcsDestination implements IGcsDestination { + + /** + * Constructs a new GcsDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IGcsDestination); + + /** GcsDestination uri. */ + public uri?: (string|null); + + /** GcsDestination uriPrefix. */ + public uriPrefix?: (string|null); + + /** GcsDestination objectUri. */ + public objectUri?: ("uri"|"uriPrefix"); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsDestination instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IGcsDestination): google.cloud.asset.v1p7beta1.GcsDestination; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p7beta1.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.v1p7beta1.IGcsDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.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.v1p7beta1.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.v1p7beta1.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.v1p7beta1.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.v1p7beta1.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.v1p7beta1.GcsDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcsDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BigQueryDestination. */ + interface IBigQueryDestination { + + /** BigQueryDestination dataset */ + dataset?: (string|null); + + /** BigQueryDestination table */ + table?: (string|null); + + /** BigQueryDestination force */ + force?: (boolean|null); + + /** BigQueryDestination partitionSpec */ + partitionSpec?: (google.cloud.asset.v1p7beta1.IPartitionSpec|null); + + /** BigQueryDestination separateTablesPerAssetType */ + separateTablesPerAssetType?: (boolean|null); + } + + /** Represents a BigQueryDestination. */ + class BigQueryDestination implements IBigQueryDestination { + + /** + * Constructs a new BigQueryDestination. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IBigQueryDestination); + + /** BigQueryDestination dataset. */ + public dataset: string; + + /** BigQueryDestination table. */ + public table: string; + + /** BigQueryDestination force. */ + public force: boolean; + + /** BigQueryDestination partitionSpec. */ + public partitionSpec?: (google.cloud.asset.v1p7beta1.IPartitionSpec|null); + + /** BigQueryDestination separateTablesPerAssetType. */ + public separateTablesPerAssetType: boolean; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @param [properties] Properties to set + * @returns BigQueryDestination instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IBigQueryDestination): google.cloud.asset.v1p7beta1.BigQueryDestination; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1p7beta1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.BigQueryDestination.verify|verify} messages. + * @param message BigQueryDestination message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IBigQueryDestination, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.BigQueryDestination; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.BigQueryDestination; + + /** + * Verifies a BigQueryDestination message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BigQueryDestination + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.BigQueryDestination; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @param message BigQueryDestination + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.BigQueryDestination, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BigQueryDestination to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BigQueryDestination + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PartitionSpec. */ + interface IPartitionSpec { + + /** PartitionSpec partitionKey */ + partitionKey?: (google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey|keyof typeof google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey|null); + } + + /** Represents a PartitionSpec. */ + class PartitionSpec implements IPartitionSpec { + + /** + * Constructs a new PartitionSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IPartitionSpec); + + /** PartitionSpec partitionKey. */ + public partitionKey: (google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey|keyof typeof google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey); + + /** + * Creates a new PartitionSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns PartitionSpec instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IPartitionSpec): google.cloud.asset.v1p7beta1.PartitionSpec; + + /** + * Encodes the specified PartitionSpec message. Does not implicitly {@link google.cloud.asset.v1p7beta1.PartitionSpec.verify|verify} messages. + * @param message PartitionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IPartitionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PartitionSpec message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.PartitionSpec.verify|verify} messages. + * @param message PartitionSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IPartitionSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PartitionSpec + * @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.v1p7beta1.PartitionSpec; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PartitionSpec + * @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.v1p7beta1.PartitionSpec; + + /** + * Verifies a PartitionSpec 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 PartitionSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PartitionSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.PartitionSpec; + + /** + * Creates a plain object from a PartitionSpec message. Also converts values to other types if specified. + * @param message PartitionSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.PartitionSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PartitionSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PartitionSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PartitionSpec { + + /** PartitionKey enum. */ + enum PartitionKey { + PARTITION_KEY_UNSPECIFIED = 0, + READ_TIME = 1, + REQUEST_TIME = 2 + } + } + + /** ContentType enum. */ + enum ContentType { + CONTENT_TYPE_UNSPECIFIED = 0, + RESOURCE = 1, + IAM_POLICY = 2, + ORG_POLICY = 4, + ACCESS_POLICY = 5, + RELATIONSHIP = 7 + } + + /** Properties of an Asset. */ + interface IAsset { + + /** Asset updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name */ + name?: (string|null); + + /** Asset assetType */ + assetType?: (string|null); + + /** Asset resource */ + resource?: (google.cloud.asset.v1p7beta1.IResource|null); + + /** Asset iamPolicy */ + iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy */ + orgPolicy?: (google.cloud.orgpolicy.v1.IPolicy[]|null); + + /** Asset accessPolicy */ + accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel */ + accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter */ + servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset relatedAssets */ + relatedAssets?: (google.cloud.asset.v1p7beta1.IRelatedAssets|null); + + /** Asset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IAsset); + + /** Asset updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Asset name. */ + public name: string; + + /** Asset assetType. */ + public assetType: string; + + /** Asset resource. */ + public resource?: (google.cloud.asset.v1p7beta1.IResource|null); + + /** Asset iamPolicy. */ + public iamPolicy?: (google.iam.v1.IPolicy|null); + + /** Asset orgPolicy. */ + public orgPolicy: google.cloud.orgpolicy.v1.IPolicy[]; + + /** Asset accessPolicy. */ + public accessPolicy?: (google.identity.accesscontextmanager.v1.IAccessPolicy|null); + + /** Asset accessLevel. */ + public accessLevel?: (google.identity.accesscontextmanager.v1.IAccessLevel|null); + + /** Asset servicePerimeter. */ + public servicePerimeter?: (google.identity.accesscontextmanager.v1.IServicePerimeter|null); + + /** Asset relatedAssets. */ + public relatedAssets?: (google.cloud.asset.v1p7beta1.IRelatedAssets|null); + + /** Asset ancestors. */ + public ancestors: string[]; + + /** Asset accessContextPolicy. */ + public accessContextPolicy?: ("accessPolicy"|"accessLevel"|"servicePerimeter"); + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IAsset): google.cloud.asset.v1p7beta1.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p7beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Asset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Resource. */ + interface IResource { + + /** Resource version */ + version?: (string|null); + + /** Resource discoveryDocumentUri */ + discoveryDocumentUri?: (string|null); + + /** Resource discoveryName */ + discoveryName?: (string|null); + + /** Resource resourceUrl */ + resourceUrl?: (string|null); + + /** Resource parent */ + parent?: (string|null); + + /** Resource data */ + data?: (google.protobuf.IStruct|null); + + /** Resource location */ + location?: (string|null); + } + + /** Represents a Resource. */ + class Resource implements IResource { + + /** + * Constructs a new Resource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IResource); + + /** Resource version. */ + public version: string; + + /** Resource discoveryDocumentUri. */ + public discoveryDocumentUri: string; + + /** Resource discoveryName. */ + public discoveryName: string; + + /** Resource resourceUrl. */ + public resourceUrl: string; + + /** Resource parent. */ + public parent: string; + + /** Resource data. */ + public data?: (google.protobuf.IStruct|null); + + /** Resource location. */ + public location: string; + + /** + * Creates a new Resource instance using the specified properties. + * @param [properties] Properties to set + * @returns Resource instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IResource): google.cloud.asset.v1p7beta1.Resource; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p7beta1.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.v1p7beta1.IResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.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.v1p7beta1.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.v1p7beta1.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.v1p7beta1.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.v1p7beta1.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.v1p7beta1.Resource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Resource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Resource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelatedAssets. */ + interface IRelatedAssets { + + /** RelatedAssets relationshipAttributes */ + relationshipAttributes?: (google.cloud.asset.v1p7beta1.IRelationshipAttributes|null); + + /** RelatedAssets assets */ + assets?: (google.cloud.asset.v1p7beta1.IRelatedAsset[]|null); + } + + /** Represents a RelatedAssets. */ + class RelatedAssets implements IRelatedAssets { + + /** + * Constructs a new RelatedAssets. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IRelatedAssets); + + /** RelatedAssets relationshipAttributes. */ + public relationshipAttributes?: (google.cloud.asset.v1p7beta1.IRelationshipAttributes|null); + + /** RelatedAssets assets. */ + public assets: google.cloud.asset.v1p7beta1.IRelatedAsset[]; + + /** + * Creates a new RelatedAssets instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAssets instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IRelatedAssets): google.cloud.asset.v1p7beta1.RelatedAssets; + + /** + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.RelatedAssets; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.RelatedAssets; + + /** + * Verifies a RelatedAssets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAssets + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.RelatedAssets; + + /** + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @param message RelatedAssets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.RelatedAssets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAssets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedAssets + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelationshipAttributes. */ + interface IRelationshipAttributes { + + /** RelationshipAttributes type */ + type?: (string|null); + + /** RelationshipAttributes sourceResourceType */ + sourceResourceType?: (string|null); + + /** RelationshipAttributes targetResourceType */ + targetResourceType?: (string|null); + + /** RelationshipAttributes action */ + action?: (string|null); + } + + /** Represents a RelationshipAttributes. */ + class RelationshipAttributes implements IRelationshipAttributes { + + /** + * Constructs a new RelationshipAttributes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IRelationshipAttributes); + + /** RelationshipAttributes type. */ + public type: string; + + /** RelationshipAttributes sourceResourceType. */ + public sourceResourceType: string; + + /** RelationshipAttributes targetResourceType. */ + public targetResourceType: string; + + /** RelationshipAttributes action. */ + public action: string; + + /** + * Creates a new RelationshipAttributes instance using the specified properties. + * @param [properties] Properties to set + * @returns RelationshipAttributes instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IRelationshipAttributes): google.cloud.asset.v1p7beta1.RelationshipAttributes; + + /** + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.RelationshipAttributes; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.RelationshipAttributes; + + /** + * Verifies a RelationshipAttributes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelationshipAttributes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.RelationshipAttributes; + + /** + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @param message RelationshipAttributes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.RelationshipAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelationshipAttributes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelationshipAttributes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelatedAsset. */ + interface IRelatedAsset { + + /** RelatedAsset asset */ + asset?: (string|null); + + /** RelatedAsset assetType */ + assetType?: (string|null); + + /** RelatedAsset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents a RelatedAsset. */ + class RelatedAsset implements IRelatedAsset { + + /** + * Constructs a new RelatedAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1p7beta1.IRelatedAsset); + + /** RelatedAsset asset. */ + public asset: string; + + /** RelatedAsset assetType. */ + public assetType: string; + + /** RelatedAsset ancestors. */ + public ancestors: string[]; + + /** + * Creates a new RelatedAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAsset instance + */ + public static create(properties?: google.cloud.asset.v1p7beta1.IRelatedAsset): google.cloud.asset.v1p7beta1.RelatedAsset; + + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1p7beta1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1p7beta1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1p7beta1.RelatedAsset; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1p7beta1.RelatedAsset; + + /** + * Verifies a RelatedAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1p7beta1.RelatedAsset; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @param message RelatedAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1p7beta1.RelatedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelatedAsset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace orgpolicy. */ + namespace orgpolicy { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy constraint */ + constraint?: (string|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + + /** Policy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Policy listPolicy */ + listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); + + /** Policy booleanPolicy */ + booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); + + /** Policy restoreDefault */ + restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy constraint. */ + public constraint: string; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** Policy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Policy listPolicy. */ + public listPolicy?: (google.cloud.orgpolicy.v1.Policy.IListPolicy|null); + + /** Policy booleanPolicy. */ + public booleanPolicy?: (google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null); + + /** Policy restoreDefault. */ + public restoreDefault?: (google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null); + + /** Policy policyType. */ + public policyType?: ("listPolicy"|"booleanPolicy"|"restoreDefault"); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.IPolicy): google.cloud.orgpolicy.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.orgpolicy.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.orgpolicy.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Policy { + + /** Properties of a ListPolicy. */ + interface IListPolicy { + + /** ListPolicy allowedValues */ + allowedValues?: (string[]|null); + + /** ListPolicy deniedValues */ + deniedValues?: (string[]|null); + + /** ListPolicy allValues */ + allValues?: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null); + + /** ListPolicy suggestedValue */ + suggestedValue?: (string|null); + + /** ListPolicy inheritFromParent */ + inheritFromParent?: (boolean|null); + } + + /** Represents a ListPolicy. */ + class ListPolicy implements IListPolicy { + + /** + * Constructs a new ListPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy); + + /** ListPolicy allowedValues. */ + public allowedValues: string[]; + + /** ListPolicy deniedValues. */ + public deniedValues: string[]; + + /** ListPolicy allValues. */ + public allValues: (google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|keyof typeof google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues); + + /** ListPolicy suggestedValue. */ + public suggestedValue: string; + + /** ListPolicy inheritFromParent. */ + public inheritFromParent: boolean; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IListPolicy): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @param message ListPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IListPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPolicy + * @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.orgpolicy.v1.Policy.ListPolicy; + + /** + * Verifies a ListPolicy 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 ListPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.ListPolicy; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @param message ListPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.ListPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListPolicy { + + /** AllValues enum. */ + enum AllValues { + ALL_VALUES_UNSPECIFIED = 0, + ALLOW = 1, + DENY = 2 + } + } + + /** Properties of a BooleanPolicy. */ + interface IBooleanPolicy { + + /** BooleanPolicy enforced */ + enforced?: (boolean|null); + } + + /** Represents a BooleanPolicy. */ + class BooleanPolicy implements IBooleanPolicy { + + /** + * Constructs a new BooleanPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy); + + /** BooleanPolicy enforced. */ + public enforced: boolean; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns BooleanPolicy instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @param message BooleanPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IBooleanPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BooleanPolicy + * @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.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Verifies a BooleanPolicy 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 BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BooleanPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.BooleanPolicy; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @param message BooleanPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.BooleanPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BooleanPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BooleanPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDefault. */ + interface IRestoreDefault { + } + + /** Represents a RestoreDefault. */ + class RestoreDefault implements IRestoreDefault { + + /** + * Constructs a new RestoreDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault); + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreDefault instance + */ + public static create(properties?: google.cloud.orgpolicy.v1.Policy.IRestoreDefault): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @param message RestoreDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.orgpolicy.v1.Policy.IRestoreDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreDefault + * @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.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Verifies a RestoreDefault 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 RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDefault + */ + public static fromObject(object: { [k: string]: any }): google.cloud.orgpolicy.v1.Policy.RestoreDefault; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @param message RestoreDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.orgpolicy.v1.Policy.RestoreDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http 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 Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings 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 CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings 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 ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing 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 Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings 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 JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings 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 CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings 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 PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings 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 PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings 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 NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings 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 DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings 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 RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings 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 GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings 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 MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning 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 LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet 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 FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto 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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto 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 DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange 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 ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions 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 ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration 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 Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto 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 FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto 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 OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto 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 EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange 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 EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto 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 EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto 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 ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto 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 MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions 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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions 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 MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions 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 FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault 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 EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions 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 OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions 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 EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions 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 EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UninterpretedOption + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NamePart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a FeatureSet. */ + interface IFeatureSet { + + /** FeatureSet fieldPresence */ + fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); + + /** FeatureSet enumType */ + enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); + + /** FeatureSet repeatedFieldEncoding */ + repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); + + /** FeatureSet utf8Validation */ + utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); + + /** FeatureSet messageEncoding */ + messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); + + /** FeatureSet jsonFormat */ + jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); + } + + /** Represents a FeatureSet. */ + class FeatureSet implements IFeatureSet { + + /** + * Constructs a new FeatureSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSet); + + /** FeatureSet fieldPresence. */ + public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); + + /** FeatureSet enumType. */ + public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); + + /** FeatureSet repeatedFieldEncoding. */ + public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); + + /** FeatureSet utf8Validation. */ + public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); + + /** FeatureSet messageEncoding. */ + public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); + + /** FeatureSet jsonFormat. */ + public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); + + /** + * Creates a new FeatureSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSet instance + */ + public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @param message FeatureSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; + + /** + * Verifies a FeatureSet 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 FeatureSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @param message FeatureSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSet { + + /** FieldPresence enum. */ + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3 + } + + /** EnumType enum. */ + enum EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2 + } + + /** RepeatedFieldEncoding enum. */ + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2 + } + + /** Utf8Validation enum. */ + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3 + } + + /** MessageEncoding enum. */ + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2 + } + + /** JsonFormat enum. */ + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2 + } + } + + /** Properties of a FeatureSetDefaults. */ + interface IFeatureSetDefaults { + + /** FeatureSetDefaults defaults */ + defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); + + /** FeatureSetDefaults minimumEdition */ + minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetDefaults maximumEdition */ + maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FeatureSetDefaults. */ + class FeatureSetDefaults implements IFeatureSetDefaults { + + /** + * Constructs a new FeatureSetDefaults. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFeatureSetDefaults); + + /** FeatureSetDefaults defaults. */ + public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; + + /** FeatureSetDefaults minimumEdition. */ + public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetDefaults maximumEdition. */ + public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetDefaults instance + */ + public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @param message FeatureSetDefaults message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; + + /** + * Verifies a FeatureSetDefaults 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 FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetDefaults + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @param message FeatureSetDefaults + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetDefaults + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FeatureSetDefaults { + + /** Properties of a FeatureSetEditionDefault. */ + interface IFeatureSetEditionDefault { + + /** FeatureSetEditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** FeatureSetEditionDefault features */ + features?: (google.protobuf.IFeatureSet|null); + } + + /** Represents a FeatureSetEditionDefault. */ + class FeatureSetEditionDefault implements IFeatureSetEditionDefault { + + /** + * Constructs a new FeatureSetEditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); + + /** FeatureSetEditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** FeatureSetEditionDefault features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns FeatureSetEditionDefault instance + */ + public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @param message FeatureSetEditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Verifies a FeatureSetEditionDefault 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 FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FeatureSetEditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @param message FeatureSetEditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SourceCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Location + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** Annotation semantic. */ + public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Annotation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Annotation { + + /** Semantic enum. */ + enum Semantic { + NONE = 0, + SET = 1, + ALIAS = 2 + } + } + } + + /** Properties of a Duration. */ + interface IDuration { + + /** Duration seconds */ + seconds?: (number|Long|string|null); + + /** Duration nanos */ + nanos?: (number|null); + } + + /** Represents a Duration. */ + class Duration implements IDuration { + + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); + + /** Duration seconds. */ + public seconds: (number|Long|string); + + /** Duration nanos. */ + public nanos: number; + + /** + * Creates a new Duration instance using the specified properties. + * @param [properties] Properties to set + * @returns Duration instance + */ + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; + + /** + * Verifies a Duration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Duration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Duration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Struct. */ + interface IStruct { + + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } + + /** Represents a Struct. */ + class Struct implements IStruct { + + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); + + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; + + /** + * Creates a new Struct instance using the specified properties. + * @param [properties] Properties to set + * @returns Struct instance + */ + public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @param message Struct message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; + + /** + * Verifies a Struct message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Struct + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @param message Struct + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Struct + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Value. */ + interface IValue { + + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue */ + numberValue?: (number|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value boolValue */ + boolValue?: (boolean|null); + + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); + + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } + + /** Represents a Value. */ + class Value implements IValue { + + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); + + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + + /** Value numberValue. */ + public numberValue?: (number|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value boolValue. */ + public boolValue?: (boolean|null); + + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); + + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); + + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + + /** + * Creates a new Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Value instance + */ + public static create(properties?: google.protobuf.IValue): google.protobuf.Value; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @param message Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; + + /** + * Verifies a Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Value; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @param message Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } + + /** Properties of a ListValue. */ + interface IListValue { + + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } + + /** Represents a ListValue. */ + class ListValue implements IListValue { + + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); + + /** ListValue values. */ + public values: google.protobuf.IValue[]; + + /** + * Creates a new ListValue instance using the specified properties. + * @param [properties] Properties to set + * @returns ListValue instance + */ + public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @param message ListValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; + + /** + * Verifies a ListValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @param message ListValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace longrunning. */ + namespace longrunning { + + /** Represents an Operations */ + class Operations extends $protobuf.rpc.Service { + + /** + * Constructs a new Operations 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 Operations 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): Operations; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListOperationsResponse + */ + public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; + + /** + * Calls ListOperations. + * @param request ListOperationsRequest message or plain object + * @returns Promise + */ + public listOperations(request: google.longrunning.IListOperationsRequest): Promise; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; + + /** + * Calls GetOperation. + * @param request GetOperationRequest message or plain object + * @returns Promise + */ + public getOperation(request: google.longrunning.IGetOperationRequest): Promise; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; + + /** + * Calls DeleteOperation. + * @param request DeleteOperationRequest message or plain object + * @returns Promise + */ + public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; + + /** + * Calls CancelOperation. + * @param request CancelOperationRequest message or plain object + * @returns Promise + */ + public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; + + /** + * Calls WaitOperation. + * @param request WaitOperationRequest message or plain object + * @returns Promise + */ + public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; + } + + namespace Operations { + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @param error Error, if any + * @param [response] ListOperationsResponse + */ + type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @param error Error, if any + * @param [response] Empty + */ + type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @param error Error, if any + * @param [response] Operation + */ + type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Operation. */ + interface IOperation { + + /** Operation name */ + name?: (string|null); + + /** Operation metadata */ + metadata?: (google.protobuf.IAny|null); + + /** Operation done */ + done?: (boolean|null); + + /** Operation error */ + error?: (google.rpc.IStatus|null); + + /** Operation response */ + response?: (google.protobuf.IAny|null); + } + + /** Represents an Operation. */ + class Operation implements IOperation { + + /** + * Constructs a new Operation. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperation); + + /** Operation name. */ + public name: string; + + /** Operation metadata. */ + public metadata?: (google.protobuf.IAny|null); + + /** Operation done. */ + public done: boolean; + + /** Operation error. */ + public error?: (google.rpc.IStatus|null); + + /** Operation response. */ + public response?: (google.protobuf.IAny|null); + + /** Operation result. */ + public result?: ("error"|"response"); + + /** + * Creates a new Operation instance using the specified properties. + * @param [properties] Properties to set + * @returns Operation instance + */ + public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @param message Operation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Operation + * @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.longrunning.Operation; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Operation + * @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.longrunning.Operation; + + /** + * Verifies an Operation 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 Operation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Operation + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @param message Operation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Operation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Operation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetOperationRequest. */ + interface IGetOperationRequest { + + /** GetOperationRequest name */ + name?: (string|null); + } + + /** Represents a GetOperationRequest. */ + class GetOperationRequest implements IGetOperationRequest { + + /** + * Constructs a new GetOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IGetOperationRequest); + + /** GetOperationRequest name. */ + public name: string; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetOperationRequest instance + */ + public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @param message GetOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetOperationRequest + * @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.longrunning.GetOperationRequest; + + /** + * Verifies a GetOperationRequest 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 GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @param message GetOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsRequest. */ + interface IListOperationsRequest { + + /** ListOperationsRequest name */ + name?: (string|null); + + /** ListOperationsRequest filter */ + filter?: (string|null); + + /** ListOperationsRequest pageSize */ + pageSize?: (number|null); + + /** ListOperationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListOperationsRequest. */ + class ListOperationsRequest implements IListOperationsRequest { + + /** + * Constructs a new ListOperationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsRequest); + + /** ListOperationsRequest name. */ + public name: string; + + /** ListOperationsRequest filter. */ + public filter: string; + + /** ListOperationsRequest pageSize. */ + public pageSize: number; + + /** ListOperationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsRequest instance + */ + public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @param message ListOperationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsRequest + * @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.longrunning.ListOperationsRequest; + + /** + * Verifies a ListOperationsRequest 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 ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @param message ListOperationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListOperationsResponse. */ + interface IListOperationsResponse { + + /** ListOperationsResponse operations */ + operations?: (google.longrunning.IOperation[]|null); + + /** ListOperationsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListOperationsResponse. */ + class ListOperationsResponse implements IListOperationsResponse { + + /** + * Constructs a new ListOperationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IListOperationsResponse); + + /** ListOperationsResponse operations. */ + public operations: google.longrunning.IOperation[]; + + /** ListOperationsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListOperationsResponse instance + */ + public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @param message ListOperationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListOperationsResponse + * @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.longrunning.ListOperationsResponse; + + /** + * Verifies a ListOperationsResponse 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 ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListOperationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @param message ListOperationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListOperationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListOperationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelOperationRequest. */ + interface ICancelOperationRequest { + + /** CancelOperationRequest name */ + name?: (string|null); + } + + /** Represents a CancelOperationRequest. */ + class CancelOperationRequest implements ICancelOperationRequest { + + /** + * Constructs a new CancelOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.ICancelOperationRequest); + + /** CancelOperationRequest name. */ + public name: string; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelOperationRequest instance + */ + public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @param message CancelOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelOperationRequest + * @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.longrunning.CancelOperationRequest; + + /** + * Verifies a CancelOperationRequest 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 CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @param message CancelOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteOperationRequest. */ + interface IDeleteOperationRequest { + + /** DeleteOperationRequest name */ + name?: (string|null); + } + + /** Represents a DeleteOperationRequest. */ + class DeleteOperationRequest implements IDeleteOperationRequest { + + /** + * Constructs a new DeleteOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IDeleteOperationRequest); + + /** DeleteOperationRequest name. */ + public name: string; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteOperationRequest instance + */ + public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @param message DeleteOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteOperationRequest + * @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.longrunning.DeleteOperationRequest; + + /** + * Verifies a DeleteOperationRequest 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 DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @param message DeleteOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WaitOperationRequest. */ + interface IWaitOperationRequest { + + /** WaitOperationRequest name */ + name?: (string|null); + + /** WaitOperationRequest timeout */ + timeout?: (google.protobuf.IDuration|null); + } + + /** Represents a WaitOperationRequest. */ + class WaitOperationRequest implements IWaitOperationRequest { + + /** + * Constructs a new WaitOperationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IWaitOperationRequest); + + /** WaitOperationRequest name. */ + public name: string; + + /** WaitOperationRequest timeout. */ + public timeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WaitOperationRequest instance + */ + public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @param message WaitOperationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WaitOperationRequest + * @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.longrunning.WaitOperationRequest; + + /** + * Verifies a WaitOperationRequest 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 WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WaitOperationRequest + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @param message WaitOperationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WaitOperationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WaitOperationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationInfo. */ + interface IOperationInfo { + + /** OperationInfo responseType */ + responseType?: (string|null); + + /** OperationInfo metadataType */ + metadataType?: (string|null); + } + + /** Represents an OperationInfo. */ + class OperationInfo implements IOperationInfo { + + /** + * Constructs a new OperationInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.longrunning.IOperationInfo); + + /** OperationInfo responseType. */ + public responseType: string; + + /** OperationInfo metadataType. */ + public metadataType: string; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationInfo instance + */ + public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @param message OperationInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationInfo + * @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.longrunning.OperationInfo; + + /** + * Verifies an OperationInfo 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 OperationInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationInfo + */ + public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @param message OperationInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @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.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @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.rpc.Status; + + /** + * Verifies a Status 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 Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @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.iam.v1.Policy; + + /** + * Verifies a Policy 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 Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @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.iam.v1.Binding; + + /** + * Verifies a Binding 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 Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @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.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @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.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @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.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta 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 PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @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.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta 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 BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @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.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace identity. */ + namespace identity { + + /** Namespace accesscontextmanager. */ + namespace accesscontextmanager { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an AccessLevel. */ + interface IAccessLevel { + + /** AccessLevel name */ + name?: (string|null); + + /** AccessLevel title */ + title?: (string|null); + + /** AccessLevel description */ + description?: (string|null); + + /** AccessLevel basic */ + basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom */ + custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AccessLevel. */ + class AccessLevel implements IAccessLevel { + + /** + * Constructs a new AccessLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessLevel); + + /** AccessLevel name. */ + public name: string; + + /** AccessLevel title. */ + public title: string; + + /** AccessLevel description. */ + public description: string; + + /** AccessLevel basic. */ + public basic?: (google.identity.accesscontextmanager.v1.IBasicLevel|null); + + /** AccessLevel custom. */ + public custom?: (google.identity.accesscontextmanager.v1.ICustomLevel|null); + + /** AccessLevel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessLevel level. */ + public level?: ("basic"|"custom"); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessLevel): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @param message AccessLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessLevel + * @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.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Verifies an AccessLevel 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 AccessLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessLevel; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @param message AccessLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BasicLevel. */ + interface IBasicLevel { + + /** BasicLevel conditions */ + conditions?: (google.identity.accesscontextmanager.v1.ICondition[]|null); + + /** BasicLevel combiningFunction */ + combiningFunction?: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null); + } + + /** Represents a BasicLevel. */ + class BasicLevel implements IBasicLevel { + + /** + * Constructs a new BasicLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IBasicLevel); + + /** BasicLevel conditions. */ + public conditions: google.identity.accesscontextmanager.v1.ICondition[]; + + /** BasicLevel combiningFunction. */ + public combiningFunction: (google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|keyof typeof google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction); + + /** + * Creates a new BasicLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IBasicLevel): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @param message BasicLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IBasicLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicLevel + * @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.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Verifies a BasicLevel 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 BasicLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.BasicLevel; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @param message BasicLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.BasicLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BasicLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BasicLevel { + + /** ConditionCombiningFunction enum. */ + enum ConditionCombiningFunction { + AND = 0, + OR = 1 + } + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition ipSubnetworks */ + ipSubnetworks?: (string[]|null); + + /** Condition devicePolicy */ + devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels */ + requiredAccessLevels?: (string[]|null); + + /** Condition negate */ + negate?: (boolean|null); + + /** Condition members */ + members?: (string[]|null); + + /** Condition regions */ + regions?: (string[]|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICondition); + + /** Condition ipSubnetworks. */ + public ipSubnetworks: string[]; + + /** Condition devicePolicy. */ + public devicePolicy?: (google.identity.accesscontextmanager.v1.IDevicePolicy|null); + + /** Condition requiredAccessLevels. */ + public requiredAccessLevels: string[]; + + /** Condition negate. */ + public negate: boolean; + + /** Condition members. */ + public members: string[]; + + /** Condition regions. */ + public regions: string[]; + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICondition): google.identity.accesscontextmanager.v1.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @param message Condition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Condition + * @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.identity.accesscontextmanager.v1.Condition; + + /** + * Verifies a Condition 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 Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.Condition; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @param message Condition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Condition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomLevel. */ + interface ICustomLevel { + + /** CustomLevel expr */ + expr?: (google.type.IExpr|null); + } + + /** Represents a CustomLevel. */ + class CustomLevel implements ICustomLevel { + + /** + * Constructs a new CustomLevel. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ICustomLevel); + + /** CustomLevel expr. */ + public expr?: (google.type.IExpr|null); + + /** + * Creates a new CustomLevel instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomLevel instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ICustomLevel): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @param message CustomLevel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ICustomLevel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomLevel + * @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.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Verifies a CustomLevel 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 CustomLevel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomLevel + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.CustomLevel; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @param message CustomLevel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.CustomLevel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomLevel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomLevel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DevicePolicy. */ + interface IDevicePolicy { + + /** DevicePolicy requireScreenlock */ + requireScreenlock?: (boolean|null); + + /** DevicePolicy allowedEncryptionStatuses */ + allowedEncryptionStatuses?: (google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]|null); + + /** DevicePolicy osConstraints */ + osConstraints?: (google.identity.accesscontextmanager.v1.IOsConstraint[]|null); + + /** DevicePolicy allowedDeviceManagementLevels */ + allowedDeviceManagementLevels?: (google.identity.accesscontextmanager.type.DeviceManagementLevel[]|null); + + /** DevicePolicy requireAdminApproval */ + requireAdminApproval?: (boolean|null); + + /** DevicePolicy requireCorpOwned */ + requireCorpOwned?: (boolean|null); + } + + /** Represents a DevicePolicy. */ + class DevicePolicy implements IDevicePolicy { + + /** + * Constructs a new DevicePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy); + + /** DevicePolicy requireScreenlock. */ + public requireScreenlock: boolean; + + /** DevicePolicy allowedEncryptionStatuses. */ + public allowedEncryptionStatuses: google.identity.accesscontextmanager.type.DeviceEncryptionStatus[]; + + /** DevicePolicy osConstraints. */ + public osConstraints: google.identity.accesscontextmanager.v1.IOsConstraint[]; + + /** DevicePolicy allowedDeviceManagementLevels. */ + public allowedDeviceManagementLevels: google.identity.accesscontextmanager.type.DeviceManagementLevel[]; + + /** DevicePolicy requireAdminApproval. */ + public requireAdminApproval: boolean; + + /** DevicePolicy requireCorpOwned. */ + public requireCorpOwned: boolean; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns DevicePolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IDevicePolicy): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @param message DevicePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IDevicePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DevicePolicy + * @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.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Verifies a DevicePolicy 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 DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DevicePolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.DevicePolicy; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @param message DevicePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.DevicePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DevicePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DevicePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OsConstraint. */ + interface IOsConstraint { + + /** OsConstraint osType */ + osType?: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType|null); + + /** OsConstraint minimumVersion */ + minimumVersion?: (string|null); + + /** OsConstraint requireVerifiedChromeOs */ + requireVerifiedChromeOs?: (boolean|null); + } + + /** Represents an OsConstraint. */ + class OsConstraint implements IOsConstraint { + + /** + * Constructs a new OsConstraint. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IOsConstraint); + + /** OsConstraint osType. */ + public osType: (google.identity.accesscontextmanager.type.OsType|keyof typeof google.identity.accesscontextmanager.type.OsType); + + /** OsConstraint minimumVersion. */ + public minimumVersion: string; + + /** OsConstraint requireVerifiedChromeOs. */ + public requireVerifiedChromeOs: boolean; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @param [properties] Properties to set + * @returns OsConstraint instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IOsConstraint): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @param message OsConstraint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IOsConstraint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OsConstraint + * @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.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Verifies an OsConstraint 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 OsConstraint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OsConstraint + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.OsConstraint; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @param message OsConstraint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.OsConstraint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OsConstraint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OsConstraint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AccessPolicy. */ + interface IAccessPolicy { + + /** AccessPolicy name */ + name?: (string|null); + + /** AccessPolicy parent */ + parent?: (string|null); + + /** AccessPolicy title */ + title?: (string|null); + + /** AccessPolicy scopes */ + scopes?: (string[]|null); + + /** AccessPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag */ + etag?: (string|null); + } + + /** Represents an AccessPolicy. */ + class AccessPolicy implements IAccessPolicy { + + /** + * Constructs a new AccessPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy); + + /** AccessPolicy name. */ + public name: string; + + /** AccessPolicy parent. */ + public parent: string; + + /** AccessPolicy title. */ + public title: string; + + /** AccessPolicy scopes. */ + public scopes: string[]; + + /** AccessPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** AccessPolicy etag. */ + public etag: string; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IAccessPolicy): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @param message AccessPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IAccessPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessPolicy + * @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.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Verifies an AccessPolicy 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 AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.AccessPolicy; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @param message AccessPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.AccessPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServicePerimeter. */ + interface IServicePerimeter { + + /** ServicePerimeter name */ + name?: (string|null); + + /** ServicePerimeter title */ + title?: (string|null); + + /** ServicePerimeter description */ + description?: (string|null); + + /** ServicePerimeter createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType */ + perimeterType?: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null); + + /** ServicePerimeter status */ + status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec */ + spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec */ + useExplicitDryRunSpec?: (boolean|null); + } + + /** Represents a ServicePerimeter. */ + class ServicePerimeter implements IServicePerimeter { + + /** + * Constructs a new ServicePerimeter. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter); + + /** ServicePerimeter name. */ + public name: string; + + /** ServicePerimeter title. */ + public title: string; + + /** ServicePerimeter description. */ + public description: string; + + /** ServicePerimeter createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ServicePerimeter perimeterType. */ + public perimeterType: (google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType); + + /** ServicePerimeter status. */ + public status?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter spec. */ + public spec?: (google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null); + + /** ServicePerimeter useExplicitDryRunSpec. */ + public useExplicitDryRunSpec: boolean; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeter instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeter): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @param message ServicePerimeter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeter + * @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.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Verifies a ServicePerimeter 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 ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeter + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeter; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @param message ServicePerimeter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServicePerimeter { + + /** PerimeterType enum. */ + enum PerimeterType { + PERIMETER_TYPE_REGULAR = 0, + PERIMETER_TYPE_BRIDGE = 1 + } + } + + /** Properties of a ServicePerimeterConfig. */ + interface IServicePerimeterConfig { + + /** ServicePerimeterConfig resources */ + resources?: (string[]|null); + + /** ServicePerimeterConfig accessLevels */ + accessLevels?: (string[]|null); + + /** ServicePerimeterConfig restrictedServices */ + restrictedServices?: (string[]|null); + + /** ServicePerimeterConfig vpcAccessibleServices */ + vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** ServicePerimeterConfig ingressPolicies */ + ingressPolicies?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy[]|null); + + /** ServicePerimeterConfig egressPolicies */ + egressPolicies?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy[]|null); + } + + /** Represents a ServicePerimeterConfig. */ + class ServicePerimeterConfig implements IServicePerimeterConfig { + + /** + * Constructs a new ServicePerimeterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig); + + /** ServicePerimeterConfig resources. */ + public resources: string[]; + + /** ServicePerimeterConfig accessLevels. */ + public accessLevels: string[]; + + /** ServicePerimeterConfig restrictedServices. */ + public restrictedServices: string[]; + + /** ServicePerimeterConfig vpcAccessibleServices. */ + public vpcAccessibleServices?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null); + + /** ServicePerimeterConfig ingressPolicies. */ + public ingressPolicies: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy[]; + + /** ServicePerimeterConfig egressPolicies. */ + public egressPolicies: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy[]; + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ServicePerimeterConfig instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.IServicePerimeterConfig): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @param message ServicePerimeterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.IServicePerimeterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServicePerimeterConfig + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Verifies a ServicePerimeterConfig 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 ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServicePerimeterConfig + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @param message ServicePerimeterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ServicePerimeterConfig { + + /** Properties of a VpcAccessibleServices. */ + interface IVpcAccessibleServices { + + /** VpcAccessibleServices enableRestriction */ + enableRestriction?: (boolean|null); + + /** VpcAccessibleServices allowedServices */ + allowedServices?: (string[]|null); + } + + /** Represents a VpcAccessibleServices. */ + class VpcAccessibleServices implements IVpcAccessibleServices { + + /** + * Constructs a new VpcAccessibleServices. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices); + + /** VpcAccessibleServices enableRestriction. */ + public enableRestriction: boolean; + + /** VpcAccessibleServices allowedServices. */ + public allowedServices: string[]; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcAccessibleServices instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @param message VpcAccessibleServices message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcAccessibleServices + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Verifies a VpcAccessibleServices 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 VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcAccessibleServices + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @param message VpcAccessibleServices + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcAccessibleServices + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** IdentityType enum. */ + enum IdentityType { + IDENTITY_TYPE_UNSPECIFIED = 0, + ANY_IDENTITY = 1, + ANY_USER_ACCOUNT = 2, + ANY_SERVICE_ACCOUNT = 3 + } + + /** Properties of a MethodSelector. */ + interface IMethodSelector { + + /** MethodSelector method */ + method?: (string|null); + + /** MethodSelector permission */ + permission?: (string|null); + } + + /** Represents a MethodSelector. */ + class MethodSelector implements IMethodSelector { + + /** + * Constructs a new MethodSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector); + + /** MethodSelector method. */ + public method?: (string|null); + + /** MethodSelector permission. */ + public permission?: (string|null); + + /** MethodSelector kind. */ + public kind?: ("method"|"permission"); + + /** + * Creates a new MethodSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSelector instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Encodes the specified MethodSelector message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @param message MethodSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSelector message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @param message MethodSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSelector + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Decodes a MethodSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSelector + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Verifies a MethodSelector 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 MethodSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSelector + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector; + + /** + * Creates a plain object from a MethodSelector message. Also converts values to other types if specified. + * @param message MethodSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ApiOperation. */ + interface IApiOperation { + + /** ApiOperation serviceName */ + serviceName?: (string|null); + + /** ApiOperation methodSelectors */ + methodSelectors?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector[]|null); + } + + /** Represents an ApiOperation. */ + class ApiOperation implements IApiOperation { + + /** + * Constructs a new ApiOperation. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation); + + /** ApiOperation serviceName. */ + public serviceName: string; + + /** ApiOperation methodSelectors. */ + public methodSelectors: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector[]; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiOperation instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @param message ApiOperation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiOperation + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiOperation + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Verifies an ApiOperation 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 ApiOperation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiOperation + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @param message ApiOperation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiOperation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiOperation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressSource. */ + interface IIngressSource { + + /** IngressSource accessLevel */ + accessLevel?: (string|null); + + /** IngressSource resource */ + resource?: (string|null); + } + + /** Represents an IngressSource. */ + class IngressSource implements IIngressSource { + + /** + * Constructs a new IngressSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource); + + /** IngressSource accessLevel. */ + public accessLevel?: (string|null); + + /** IngressSource resource. */ + public resource?: (string|null); + + /** IngressSource source. */ + public source?: ("accessLevel"|"resource"); + + /** + * Creates a new IngressSource instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressSource instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Encodes the specified IngressSource message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @param message IngressSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressSource message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @param message IngressSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressSource + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Decodes an IngressSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressSource + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Verifies an IngressSource 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 IngressSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressSource + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource; + + /** + * Creates a plain object from an IngressSource message. Also converts values to other types if specified. + * @param message IngressSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressFrom. */ + interface IIngressFrom { + + /** IngressFrom sources */ + sources?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource[]|null); + + /** IngressFrom identities */ + identities?: (string[]|null); + + /** IngressFrom identityType */ + identityType?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null); + } + + /** Represents an IngressFrom. */ + class IngressFrom implements IIngressFrom { + + /** + * Constructs a new IngressFrom. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom); + + /** IngressFrom sources. */ + public sources: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource[]; + + /** IngressFrom identities. */ + public identities: string[]; + + /** IngressFrom identityType. */ + public identityType: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType); + + /** + * Creates a new IngressFrom instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressFrom instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Encodes the specified IngressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @param message IngressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @param message IngressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressFrom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Decodes an IngressFrom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Verifies an IngressFrom 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 IngressFrom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressFrom + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom; + + /** + * Creates a plain object from an IngressFrom message. Also converts values to other types if specified. + * @param message IngressFrom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressFrom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressFrom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressTo. */ + interface IIngressTo { + + /** IngressTo operations */ + operations?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]|null); + + /** IngressTo resources */ + resources?: (string[]|null); + } + + /** Represents an IngressTo. */ + class IngressTo implements IIngressTo { + + /** + * Constructs a new IngressTo. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo); + + /** IngressTo operations. */ + public operations: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]; + + /** IngressTo resources. */ + public resources: string[]; + + /** + * Creates a new IngressTo instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressTo instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Encodes the specified IngressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @param message IngressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @param message IngressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressTo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Decodes an IngressTo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Verifies an IngressTo 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 IngressTo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressTo + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo; + + /** + * Creates a plain object from an IngressTo message. Also converts values to other types if specified. + * @param message IngressTo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressTo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressTo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IngressPolicy. */ + interface IIngressPolicy { + + /** IngressPolicy ingressFrom */ + ingressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null); + + /** IngressPolicy ingressTo */ + ingressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null); + } + + /** Represents an IngressPolicy. */ + class IngressPolicy implements IIngressPolicy { + + /** + * Constructs a new IngressPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy); + + /** IngressPolicy ingressFrom. */ + public ingressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null); + + /** IngressPolicy ingressTo. */ + public ingressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null); + + /** + * Creates a new IngressPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IngressPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Encodes the specified IngressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @param message IngressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IngressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @param message IngressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IngressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IngressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Verifies an IngressPolicy 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 IngressPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IngressPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy; + + /** + * Creates a plain object from an IngressPolicy message. Also converts values to other types if specified. + * @param message IngressPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IngressPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IngressPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressFrom. */ + interface IEgressFrom { + + /** EgressFrom identities */ + identities?: (string[]|null); + + /** EgressFrom identityType */ + identityType?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null); + } + + /** Represents an EgressFrom. */ + class EgressFrom implements IEgressFrom { + + /** + * Constructs a new EgressFrom. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom); + + /** EgressFrom identities. */ + public identities: string[]; + + /** EgressFrom identityType. */ + public identityType: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|keyof typeof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType); + + /** + * Creates a new EgressFrom instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressFrom instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Encodes the specified EgressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @param message EgressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @param message EgressFrom message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressFrom message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Decodes an EgressFrom message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressFrom + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Verifies an EgressFrom 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 EgressFrom message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressFrom + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom; + + /** + * Creates a plain object from an EgressFrom message. Also converts values to other types if specified. + * @param message EgressFrom + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressFrom to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressFrom + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressTo. */ + interface IEgressTo { + + /** EgressTo resources */ + resources?: (string[]|null); + + /** EgressTo operations */ + operations?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]|null); + + /** EgressTo externalResources */ + externalResources?: (string[]|null); + } + + /** Represents an EgressTo. */ + class EgressTo implements IEgressTo { + + /** + * Constructs a new EgressTo. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo); + + /** EgressTo resources. */ + public resources: string[]; + + /** EgressTo operations. */ + public operations: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation[]; + + /** EgressTo externalResources. */ + public externalResources: string[]; + + /** + * Creates a new EgressTo instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressTo instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Encodes the specified EgressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @param message EgressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @param message EgressTo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressTo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Decodes an EgressTo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressTo + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Verifies an EgressTo 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 EgressTo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressTo + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo; + + /** + * Creates a plain object from an EgressTo message. Also converts values to other types if specified. + * @param message EgressTo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressTo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressTo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EgressPolicy. */ + interface IEgressPolicy { + + /** EgressPolicy egressFrom */ + egressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null); + + /** EgressPolicy egressTo */ + egressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null); + } + + /** Represents an EgressPolicy. */ + class EgressPolicy implements IEgressPolicy { + + /** + * Constructs a new EgressPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy); + + /** EgressPolicy egressFrom. */ + public egressFrom?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null); + + /** EgressPolicy egressTo. */ + public egressTo?: (google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null); + + /** + * Creates a new EgressPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns EgressPolicy instance + */ + public static create(properties?: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Encodes the specified EgressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @param message EgressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EgressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @param message EgressPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EgressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EgressPolicy + * @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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Verifies an EgressPolicy 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 EgressPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EgressPolicy + */ + public static fromObject(object: { [k: string]: any }): google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy; + + /** + * Creates a plain object from an EgressPolicy message. Also converts values to other types if specified. + * @param message EgressPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EgressPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EgressPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Namespace type. */ + namespace type { + + /** DeviceEncryptionStatus enum. */ + enum DeviceEncryptionStatus { + ENCRYPTION_UNSPECIFIED = 0, + ENCRYPTION_UNSUPPORTED = 1, + UNENCRYPTED = 2, + ENCRYPTED = 3 + } + + /** OsType enum. */ + enum OsType { + OS_UNSPECIFIED = 0, + DESKTOP_MAC = 1, + DESKTOP_WINDOWS = 2, + DESKTOP_LINUX = 3, + DESKTOP_CHROME_OS = 6, + ANDROID = 4, + IOS = 5 + } + + /** DeviceManagementLevel enum. */ + enum DeviceManagementLevel { + MANAGEMENT_UNSPECIFIED = 0, + NONE = 1, + BASIC = 2, + COMPLETE = 3 + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.js b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.js new file mode 100644 index 00000000000..0f81a059c9e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.js @@ -0,0 +1,35403 @@ +// Copyright 2024 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. + +/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ +(function(global, factory) { /* global define, require, module */ + + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots._google_cloud_asset_protos || ($protobuf.roots._google_cloud_asset_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.asset = (function() { + + /** + * Namespace asset. + * @memberof google.cloud + * @namespace + */ + var asset = {}; + + asset.v1p7beta1 = (function() { + + /** + * Namespace v1p7beta1. + * @memberof google.cloud.asset + * @namespace + */ + var v1p7beta1 = {}; + + v1p7beta1.AssetService = (function() { + + /** + * Constructs a new AssetService service. + * @memberof google.cloud.asset.v1p7beta1 + * @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.v1p7beta1.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.v1p7beta1.AssetService|exportAssets}. + * @memberof google.cloud.asset.v1p7beta1.AssetService + * @typedef ExportAssetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1p7beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p7beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @param {google.cloud.asset.v1p7beta1.AssetService.ExportAssetsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AssetService.prototype.exportAssets = function exportAssets(request, callback) { + return this.rpcCall(exportAssets, $root.google.cloud.asset.v1p7beta1.ExportAssetsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAssets" }); + + /** + * Calls ExportAssets. + * @function exportAssets + * @memberof google.cloud.asset.v1p7beta1.AssetService + * @instance + * @param {google.cloud.asset.v1p7beta1.IExportAssetsRequest} request ExportAssetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AssetService; + })(); + + v1p7beta1.ExportAssetsRequest = (function() { + + /** + * Properties of an ExportAssetsRequest. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IExportAssetsRequest + * @property {string|null} [parent] ExportAssetsRequest parent + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsRequest readTime + * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes + * @property {google.cloud.asset.v1p7beta1.ContentType|null} [contentType] ExportAssetsRequest contentType + * @property {google.cloud.asset.v1p7beta1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + * @property {Array.|null} [relationshipTypes] ExportAssetsRequest relationshipTypes + */ + + /** + * Constructs a new ExportAssetsRequest. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents an ExportAssetsRequest. + * @implements IExportAssetsRequest + * @constructor + * @param {google.cloud.asset.v1p7beta1.IExportAssetsRequest=} [properties] Properties to set + */ + function ExportAssetsRequest(properties) { + this.assetTypes = []; + this.relationshipTypes = []; + 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]]; + } + + /** + * ExportAssetsRequest parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.parent = ""; + + /** + * ExportAssetsRequest readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.readTime = null; + + /** + * ExportAssetsRequest assetTypes. + * @member {Array.} assetTypes + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.assetTypes = $util.emptyArray; + + /** + * ExportAssetsRequest contentType. + * @member {google.cloud.asset.v1p7beta1.ContentType} contentType + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.contentType = 0; + + /** + * ExportAssetsRequest outputConfig. + * @member {google.cloud.asset.v1p7beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.outputConfig = null; + + /** + * ExportAssetsRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.relationshipTypes = $util.emptyArray; + + /** + * Creates a new ExportAssetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1p7beta1.IExportAssetsRequest=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.ExportAssetsRequest} ExportAssetsRequest instance + */ + ExportAssetsRequest.create = function create(properties) { + return new ExportAssetsRequest(properties); + }; + + /** + * Encodes the specified ExportAssetsRequest message. Does not implicitly {@link google.cloud.asset.v1p7beta1.ExportAssetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1p7beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.assetTypes != null && message.assetTypes.length) + for (var i = 0; i < message.assetTypes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.assetTypes[i]); + if (message.contentType != null && Object.hasOwnProperty.call(message, "contentType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1p7beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.relationshipTypes[i]); + return writer; + }; + + /** + * Encodes the specified ExportAssetsRequest message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.ExportAssetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1p7beta1.IExportAssetsRequest} message ExportAssetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p7beta1.ExportAssetsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.assetTypes && message.assetTypes.length)) + message.assetTypes = []; + message.assetTypes.push(reader.string()); + break; + } + case 4: { + message.contentType = reader.int32(); + break; + } + case 5: { + message.outputConfig = $root.google.cloud.asset.v1p7beta1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.ExportAssetsRequest} ExportAssetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsRequest message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.assetTypes != null && message.hasOwnProperty("assetTypes")) { + if (!Array.isArray(message.assetTypes)) + return "assetTypes: array expected"; + for (var i = 0; i < message.assetTypes.length; ++i) + if (!$util.isString(message.assetTypes[i])) + return "assetTypes: string[] expected"; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + switch (message.contentType) { + default: + return "contentType: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 5: + case 7: + break; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p7beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } + return null; + }; + + /** + * Creates an ExportAssetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.ExportAssetsRequest} ExportAssetsRequest + */ + ExportAssetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.ExportAssetsRequest) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.ExportAssetsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.ExportAssetsRequest.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.assetTypes) { + if (!Array.isArray(object.assetTypes)) + throw TypeError(".google.cloud.asset.v1p7beta1.ExportAssetsRequest.assetTypes: array expected"); + message.assetTypes = []; + for (var i = 0; i < object.assetTypes.length; ++i) + message.assetTypes[i] = String(object.assetTypes[i]); + } + switch (object.contentType) { + default: + if (typeof object.contentType === "number") { + message.contentType = object.contentType; + break; + } + break; + case "CONTENT_TYPE_UNSPECIFIED": + case 0: + message.contentType = 0; + break; + case "RESOURCE": + case 1: + message.contentType = 1; + break; + case "IAM_POLICY": + case 2: + message.contentType = 2; + break; + case "ORG_POLICY": + case 4: + message.contentType = 4; + break; + case "ACCESS_POLICY": + case 5: + message.contentType = 5; + break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.ExportAssetsRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p7beta1.OutputConfig.fromObject(object.outputConfig); + } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1p7beta1.ExportAssetsRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {google.cloud.asset.v1p7beta1.ExportAssetsRequest} message ExportAssetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.assetTypes = []; + object.relationshipTypes = []; + } + if (options.defaults) { + object.parent = ""; + object.readTime = null; + object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; + object.outputConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.assetTypes && message.assetTypes.length) { + object.assetTypes = []; + for (var j = 0; j < message.assetTypes.length; ++j) + object.assetTypes[j] = message.assetTypes[j]; + } + if (message.contentType != null && message.hasOwnProperty("contentType")) + object.contentType = options.enums === String ? $root.google.cloud.asset.v1p7beta1.ContentType[message.contentType] === undefined ? message.contentType : $root.google.cloud.asset.v1p7beta1.ContentType[message.contentType] : message.contentType; + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p7beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } + return object; + }; + + /** + * Converts this ExportAssetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAssetsRequest + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAssetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.ExportAssetsRequest"; + }; + + return ExportAssetsRequest; + })(); + + v1p7beta1.ExportAssetsResponse = (function() { + + /** + * Properties of an ExportAssetsResponse. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IExportAssetsResponse + * @property {google.protobuf.ITimestamp|null} [readTime] ExportAssetsResponse readTime + * @property {google.cloud.asset.v1p7beta1.IOutputConfig|null} [outputConfig] ExportAssetsResponse outputConfig + * @property {google.cloud.asset.v1p7beta1.IOutputResult|null} [outputResult] ExportAssetsResponse outputResult + */ + + /** + * Constructs a new ExportAssetsResponse. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents an ExportAssetsResponse. + * @implements IExportAssetsResponse + * @constructor + * @param {google.cloud.asset.v1p7beta1.IExportAssetsResponse=} [properties] Properties to set + */ + function ExportAssetsResponse(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]]; + } + + /** + * ExportAssetsResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.readTime = null; + + /** + * ExportAssetsResponse outputConfig. + * @member {google.cloud.asset.v1p7beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputConfig = null; + + /** + * ExportAssetsResponse outputResult. + * @member {google.cloud.asset.v1p7beta1.IOutputResult|null|undefined} outputResult + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @instance + */ + ExportAssetsResponse.prototype.outputResult = null; + + /** + * Creates a new ExportAssetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p7beta1.IExportAssetsResponse=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.ExportAssetsResponse} ExportAssetsResponse instance + */ + ExportAssetsResponse.create = function create(properties) { + return new ExportAssetsResponse(properties); + }; + + /** + * Encodes the specified ExportAssetsResponse message. Does not implicitly {@link google.cloud.asset.v1p7beta1.ExportAssetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p7beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.asset.v1p7beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.outputResult != null && Object.hasOwnProperty.call(message, "outputResult")) + $root.google.cloud.asset.v1p7beta1.OutputResult.encode(message.outputResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExportAssetsResponse message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.ExportAssetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p7beta1.IExportAssetsResponse} message ExportAssetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAssetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p7beta1.ExportAssetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.outputConfig = $root.google.cloud.asset.v1p7beta1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.outputResult = $root.google.cloud.asset.v1p7beta1.OutputResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAssetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.ExportAssetsResponse} ExportAssetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAssetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAssetsResponse message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAssetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.asset.v1p7beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.outputResult != null && message.hasOwnProperty("outputResult")) { + var error = $root.google.cloud.asset.v1p7beta1.OutputResult.verify(message.outputResult); + if (error) + return "outputResult." + error; + } + return null; + }; + + /** + * Creates an ExportAssetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.ExportAssetsResponse} ExportAssetsResponse + */ + ExportAssetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.ExportAssetsResponse) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.ExportAssetsResponse(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.ExportAssetsResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.ExportAssetsResponse.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.asset.v1p7beta1.OutputConfig.fromObject(object.outputConfig); + } + if (object.outputResult != null) { + if (typeof object.outputResult !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.ExportAssetsResponse.outputResult: object expected"); + message.outputResult = $root.google.cloud.asset.v1p7beta1.OutputResult.fromObject(object.outputResult); + } + return message; + }; + + /** + * Creates a plain object from an ExportAssetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {google.cloud.asset.v1p7beta1.ExportAssetsResponse} message ExportAssetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAssetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readTime = null; + object.outputConfig = null; + object.outputResult = null; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.asset.v1p7beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.outputResult != null && message.hasOwnProperty("outputResult")) + object.outputResult = $root.google.cloud.asset.v1p7beta1.OutputResult.toObject(message.outputResult, options); + return object; + }; + + /** + * Converts this ExportAssetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAssetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportAssetsResponse + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.ExportAssetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportAssetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.ExportAssetsResponse"; + }; + + return ExportAssetsResponse; + })(); + + v1p7beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IOutputConfig + * @property {google.cloud.asset.v1p7beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + * @property {google.cloud.asset.v1p7beta1.IBigQueryDestination|null} [bigqueryDestination] OutputConfig bigqueryDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.asset.v1p7beta1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(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]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.asset.v1p7beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + /** + * OutputConfig bigqueryDestination. + * @member {google.cloud.asset.v1p7beta1.IBigQueryDestination|null|undefined} bigqueryDestination + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.bigqueryDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|"bigqueryDestination"|undefined} destination + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination", "bigqueryDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p7beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.asset.v1p7beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p7beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.asset.v1p7beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigqueryDestination != null && Object.hasOwnProperty.call(message, "bigqueryDestination")) + $root.google.cloud.asset.v1p7beta1.BigQueryDestination.encode(message.bigqueryDestination, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p7beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p7beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.asset.v1p7beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigqueryDestination = $root.google.cloud.asset.v1p7beta1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + 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.v1p7beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + if (properties.destination === 1) + return "destination: multiple values"; + properties.destination = 1; + { + var error = $root.google.cloud.asset.v1p7beta1.BigQueryDestination.verify(message.bigqueryDestination); + if (error) + return "bigqueryDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.OutputConfig) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.asset.v1p7beta1.GcsDestination.fromObject(object.gcsDestination); + } + if (object.bigqueryDestination != null) { + if (typeof object.bigqueryDestination !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.OutputConfig.bigqueryDestination: object expected"); + message.bigqueryDestination = $root.google.cloud.asset.v1p7beta1.BigQueryDestination.fromObject(object.bigqueryDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {google.cloud.asset.v1p7beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.asset.v1p7beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + if (message.bigqueryDestination != null && message.hasOwnProperty("bigqueryDestination")) { + object.bigqueryDestination = $root.google.cloud.asset.v1p7beta1.BigQueryDestination.toObject(message.bigqueryDestination, options); + if (options.oneofs) + object.destination = "bigqueryDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1p7beta1.OutputResult = (function() { + + /** + * Properties of an OutputResult. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IOutputResult + * @property {google.cloud.asset.v1p7beta1.IGcsOutputResult|null} [gcsResult] OutputResult gcsResult + */ + + /** + * Constructs a new OutputResult. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents an OutputResult. + * @implements IOutputResult + * @constructor + * @param {google.cloud.asset.v1p7beta1.IOutputResult=} [properties] Properties to set + */ + function OutputResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputResult gcsResult. + * @member {google.cloud.asset.v1p7beta1.IGcsOutputResult|null|undefined} gcsResult + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @instance + */ + OutputResult.prototype.gcsResult = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputResult result. + * @member {"gcsResult"|undefined} result + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @instance + */ + Object.defineProperty(OutputResult.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["gcsResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {google.cloud.asset.v1p7beta1.IOutputResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.OutputResult} OutputResult instance + */ + OutputResult.create = function create(properties) { + return new OutputResult(properties); + }; + + /** + * Encodes the specified OutputResult message. Does not implicitly {@link google.cloud.asset.v1p7beta1.OutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {google.cloud.asset.v1p7beta1.IOutputResult} message OutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsResult != null && Object.hasOwnProperty.call(message, "gcsResult")) + $root.google.cloud.asset.v1p7beta1.GcsOutputResult.encode(message.gcsResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.OutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {google.cloud.asset.v1p7beta1.IOutputResult} message OutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.OutputResult} OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p7beta1.OutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsResult = $root.google.cloud.asset.v1p7beta1.GcsOutputResult.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.OutputResult} OutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputResult message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + properties.result = 1; + { + var error = $root.google.cloud.asset.v1p7beta1.GcsOutputResult.verify(message.gcsResult); + if (error) + return "gcsResult." + error; + } + } + return null; + }; + + /** + * Creates an OutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.OutputResult} OutputResult + */ + OutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.OutputResult) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.OutputResult(); + if (object.gcsResult != null) { + if (typeof object.gcsResult !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.OutputResult.gcsResult: object expected"); + message.gcsResult = $root.google.cloud.asset.v1p7beta1.GcsOutputResult.fromObject(object.gcsResult); + } + return message; + }; + + /** + * Creates a plain object from an OutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {google.cloud.asset.v1p7beta1.OutputResult} message OutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsResult != null && message.hasOwnProperty("gcsResult")) { + object.gcsResult = $root.google.cloud.asset.v1p7beta1.GcsOutputResult.toObject(message.gcsResult, options); + if (options.oneofs) + object.result = "gcsResult"; + } + return object; + }; + + /** + * Converts this OutputResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @instance + * @returns {Object.} JSON object + */ + OutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.OutputResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.OutputResult"; + }; + + return OutputResult; + })(); + + v1p7beta1.GcsOutputResult = (function() { + + /** + * Properties of a GcsOutputResult. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IGcsOutputResult + * @property {Array.|null} [uris] GcsOutputResult uris + */ + + /** + * Constructs a new GcsOutputResult. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents a GcsOutputResult. + * @implements IGcsOutputResult + * @constructor + * @param {google.cloud.asset.v1p7beta1.IGcsOutputResult=} [properties] Properties to set + */ + function GcsOutputResult(properties) { + this.uris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsOutputResult uris. + * @member {Array.} uris + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @instance + */ + GcsOutputResult.prototype.uris = $util.emptyArray; + + /** + * Creates a new GcsOutputResult instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1p7beta1.IGcsOutputResult=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.GcsOutputResult} GcsOutputResult instance + */ + GcsOutputResult.create = function create(properties) { + return new GcsOutputResult(properties); + }; + + /** + * Encodes the specified GcsOutputResult message. Does not implicitly {@link google.cloud.asset.v1p7beta1.GcsOutputResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1p7beta1.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified GcsOutputResult message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.GcsOutputResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1p7beta1.IGcsOutputResult} message GcsOutputResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsOutputResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p7beta1.GcsOutputResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsOutputResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.GcsOutputResult} GcsOutputResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsOutputResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsOutputResult message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsOutputResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates a GcsOutputResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.GcsOutputResult} GcsOutputResult + */ + GcsOutputResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.GcsOutputResult) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.GcsOutputResult(); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.asset.v1p7beta1.GcsOutputResult.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsOutputResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {google.cloud.asset.v1p7beta1.GcsOutputResult} message GcsOutputResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsOutputResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uris = []; + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this GcsOutputResult to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @instance + * @returns {Object.} JSON object + */ + GcsOutputResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsOutputResult + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.GcsOutputResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsOutputResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.GcsOutputResult"; + }; + + return GcsOutputResult; + })(); + + v1p7beta1.GcsDestination = (function() { + + /** + * Properties of a GcsDestination. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IGcsDestination + * @property {string|null} [uri] GcsDestination uri + * @property {string|null} [uriPrefix] GcsDestination uriPrefix + */ + + /** + * Constructs a new GcsDestination. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents a GcsDestination. + * @implements IGcsDestination + * @constructor + * @param {google.cloud.asset.v1p7beta1.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|null|undefined} uri + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uri = null; + + /** + * GcsDestination uriPrefix. + * @member {string|null|undefined} uriPrefix + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @instance + */ + GcsDestination.prototype.uriPrefix = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GcsDestination objectUri. + * @member {"uri"|"uriPrefix"|undefined} objectUri + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @instance + */ + Object.defineProperty(GcsDestination.prototype, "objectUri", { + get: $util.oneOfGetter($oneOfFields = ["uri", "uriPrefix"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GcsDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p7beta1.IGcsDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.GcsDestination} GcsDestination instance + */ + GcsDestination.create = function create(properties) { + return new GcsDestination(properties); + }; + + /** + * Encodes the specified GcsDestination message. Does not implicitly {@link google.cloud.asset.v1p7beta1.GcsDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p7beta1.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 && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.uriPrefix != null && Object.hasOwnProperty.call(message, "uriPrefix")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uriPrefix); + return writer; + }; + + /** + * Encodes the specified GcsDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.GcsDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p7beta1.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.v1p7beta1.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.v1p7beta1.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.v1p7beta1.GcsDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + message.uriPrefix = 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.v1p7beta1.GcsDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.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.v1p7beta1.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"; + var properties = {}; + if (message.uri != null && message.hasOwnProperty("uri")) { + properties.objectUri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + if (properties.objectUri === 1) + return "objectUri: multiple values"; + properties.objectUri = 1; + if (!$util.isString(message.uriPrefix)) + return "uriPrefix: string expected"; + } + return null; + }; + + /** + * Creates a GcsDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.GcsDestination} GcsDestination + */ + GcsDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.GcsDestination) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.GcsDestination(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.uriPrefix != null) + message.uriPrefix = String(object.uriPrefix); + return message; + }; + + /** + * Creates a plain object from a GcsDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @static + * @param {google.cloud.asset.v1p7beta1.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 (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object.objectUri = "uri"; + } + if (message.uriPrefix != null && message.hasOwnProperty("uriPrefix")) { + object.uriPrefix = message.uriPrefix; + if (options.oneofs) + object.objectUri = "uriPrefix"; + } + return object; + }; + + /** + * Converts this GcsDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @instance + * @returns {Object.} JSON object + */ + GcsDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcsDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.GcsDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcsDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.GcsDestination"; + }; + + return GcsDestination; + })(); + + v1p7beta1.BigQueryDestination = (function() { + + /** + * Properties of a BigQueryDestination. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IBigQueryDestination + * @property {string|null} [dataset] BigQueryDestination dataset + * @property {string|null} [table] BigQueryDestination table + * @property {boolean|null} [force] BigQueryDestination force + * @property {google.cloud.asset.v1p7beta1.IPartitionSpec|null} [partitionSpec] BigQueryDestination partitionSpec + * @property {boolean|null} [separateTablesPerAssetType] BigQueryDestination separateTablesPerAssetType + */ + + /** + * Constructs a new BigQueryDestination. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents a BigQueryDestination. + * @implements IBigQueryDestination + * @constructor + * @param {google.cloud.asset.v1p7beta1.IBigQueryDestination=} [properties] Properties to set + */ + function BigQueryDestination(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]]; + } + + /** + * BigQueryDestination dataset. + * @member {string} dataset + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.dataset = ""; + + /** + * BigQueryDestination table. + * @member {string} table + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.table = ""; + + /** + * BigQueryDestination force. + * @member {boolean} force + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.force = false; + + /** + * BigQueryDestination partitionSpec. + * @member {google.cloud.asset.v1p7beta1.IPartitionSpec|null|undefined} partitionSpec + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.partitionSpec = null; + + /** + * BigQueryDestination separateTablesPerAssetType. + * @member {boolean} separateTablesPerAssetType + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @instance + */ + BigQueryDestination.prototype.separateTablesPerAssetType = false; + + /** + * Creates a new BigQueryDestination instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1p7beta1.IBigQueryDestination=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.BigQueryDestination} BigQueryDestination instance + */ + BigQueryDestination.create = function create(properties) { + return new BigQueryDestination(properties); + }; + + /** + * Encodes the specified BigQueryDestination message. Does not implicitly {@link google.cloud.asset.v1p7beta1.BigQueryDestination.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1p7beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.dataset); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.partitionSpec != null && Object.hasOwnProperty.call(message, "partitionSpec")) + $root.google.cloud.asset.v1p7beta1.PartitionSpec.encode(message.partitionSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.separateTablesPerAssetType != null && Object.hasOwnProperty.call(message, "separateTablesPerAssetType")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.separateTablesPerAssetType); + return writer; + }; + + /** + * Encodes the specified BigQueryDestination message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.BigQueryDestination.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1p7beta1.IBigQueryDestination} message BigQueryDestination message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BigQueryDestination.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p7beta1.BigQueryDestination(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dataset = reader.string(); + break; + } + case 2: { + message.table = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + case 4: { + message.partitionSpec = $root.google.cloud.asset.v1p7beta1.PartitionSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.separateTablesPerAssetType = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BigQueryDestination message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.BigQueryDestination} BigQueryDestination + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BigQueryDestination.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BigQueryDestination message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BigQueryDestination.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) + if (!$util.isString(message.dataset)) + return "dataset: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.partitionSpec != null && message.hasOwnProperty("partitionSpec")) { + var error = $root.google.cloud.asset.v1p7beta1.PartitionSpec.verify(message.partitionSpec); + if (error) + return "partitionSpec." + error; + } + if (message.separateTablesPerAssetType != null && message.hasOwnProperty("separateTablesPerAssetType")) + if (typeof message.separateTablesPerAssetType !== "boolean") + return "separateTablesPerAssetType: boolean expected"; + return null; + }; + + /** + * Creates a BigQueryDestination message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.BigQueryDestination} BigQueryDestination + */ + BigQueryDestination.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.BigQueryDestination) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.BigQueryDestination(); + if (object.dataset != null) + message.dataset = String(object.dataset); + if (object.table != null) + message.table = String(object.table); + if (object.force != null) + message.force = Boolean(object.force); + if (object.partitionSpec != null) { + if (typeof object.partitionSpec !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.BigQueryDestination.partitionSpec: object expected"); + message.partitionSpec = $root.google.cloud.asset.v1p7beta1.PartitionSpec.fromObject(object.partitionSpec); + } + if (object.separateTablesPerAssetType != null) + message.separateTablesPerAssetType = Boolean(object.separateTablesPerAssetType); + return message; + }; + + /** + * Creates a plain object from a BigQueryDestination message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {google.cloud.asset.v1p7beta1.BigQueryDestination} message BigQueryDestination + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BigQueryDestination.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dataset = ""; + object.table = ""; + object.force = false; + object.partitionSpec = null; + object.separateTablesPerAssetType = false; + } + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = message.dataset; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.partitionSpec != null && message.hasOwnProperty("partitionSpec")) + object.partitionSpec = $root.google.cloud.asset.v1p7beta1.PartitionSpec.toObject(message.partitionSpec, options); + if (message.separateTablesPerAssetType != null && message.hasOwnProperty("separateTablesPerAssetType")) + object.separateTablesPerAssetType = message.separateTablesPerAssetType; + return object; + }; + + /** + * Converts this BigQueryDestination to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @instance + * @returns {Object.} JSON object + */ + BigQueryDestination.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BigQueryDestination + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.BigQueryDestination + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BigQueryDestination.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.BigQueryDestination"; + }; + + return BigQueryDestination; + })(); + + v1p7beta1.PartitionSpec = (function() { + + /** + * Properties of a PartitionSpec. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IPartitionSpec + * @property {google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey|null} [partitionKey] PartitionSpec partitionKey + */ + + /** + * Constructs a new PartitionSpec. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents a PartitionSpec. + * @implements IPartitionSpec + * @constructor + * @param {google.cloud.asset.v1p7beta1.IPartitionSpec=} [properties] Properties to set + */ + function PartitionSpec(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]]; + } + + /** + * PartitionSpec partitionKey. + * @member {google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey} partitionKey + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @instance + */ + PartitionSpec.prototype.partitionKey = 0; + + /** + * Creates a new PartitionSpec instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {google.cloud.asset.v1p7beta1.IPartitionSpec=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.PartitionSpec} PartitionSpec instance + */ + PartitionSpec.create = function create(properties) { + return new PartitionSpec(properties); + }; + + /** + * Encodes the specified PartitionSpec message. Does not implicitly {@link google.cloud.asset.v1p7beta1.PartitionSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {google.cloud.asset.v1p7beta1.IPartitionSpec} message PartitionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partitionKey != null && Object.hasOwnProperty.call(message, "partitionKey")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partitionKey); + return writer; + }; + + /** + * Encodes the specified PartitionSpec message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.PartitionSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {google.cloud.asset.v1p7beta1.IPartitionSpec} message PartitionSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.PartitionSpec} PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSpec.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.v1p7beta1.PartitionSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.partitionKey = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.PartitionSpec} PartitionSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PartitionSpec message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + switch (message.partitionKey) { + default: + return "partitionKey: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PartitionSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.PartitionSpec} PartitionSpec + */ + PartitionSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.PartitionSpec) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.PartitionSpec(); + switch (object.partitionKey) { + default: + if (typeof object.partitionKey === "number") { + message.partitionKey = object.partitionKey; + break; + } + break; + case "PARTITION_KEY_UNSPECIFIED": + case 0: + message.partitionKey = 0; + break; + case "READ_TIME": + case 1: + message.partitionKey = 1; + break; + case "REQUEST_TIME": + case 2: + message.partitionKey = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a PartitionSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {google.cloud.asset.v1p7beta1.PartitionSpec} message PartitionSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.partitionKey = options.enums === String ? "PARTITION_KEY_UNSPECIFIED" : 0; + if (message.partitionKey != null && message.hasOwnProperty("partitionKey")) + object.partitionKey = options.enums === String ? $root.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey[message.partitionKey] === undefined ? message.partitionKey : $root.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey[message.partitionKey] : message.partitionKey; + return object; + }; + + /** + * Converts this PartitionSpec to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @instance + * @returns {Object.} JSON object + */ + PartitionSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PartitionSpec + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.PartitionSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PartitionSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.PartitionSpec"; + }; + + /** + * PartitionKey enum. + * @name google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey + * @enum {number} + * @property {number} PARTITION_KEY_UNSPECIFIED=0 PARTITION_KEY_UNSPECIFIED value + * @property {number} READ_TIME=1 READ_TIME value + * @property {number} REQUEST_TIME=2 REQUEST_TIME value + */ + PartitionSpec.PartitionKey = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PARTITION_KEY_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_TIME"] = 1; + values[valuesById[2] = "REQUEST_TIME"] = 2; + return values; + })(); + + return PartitionSpec; + })(); + + /** + * ContentType enum. + * @name google.cloud.asset.v1p7beta1.ContentType + * @enum {number} + * @property {number} CONTENT_TYPE_UNSPECIFIED=0 CONTENT_TYPE_UNSPECIFIED value + * @property {number} RESOURCE=1 RESOURCE value + * @property {number} IAM_POLICY=2 IAM_POLICY value + * @property {number} ORG_POLICY=4 ORG_POLICY value + * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value + * @property {number} RELATIONSHIP=7 RELATIONSHIP value + */ + v1p7beta1.ContentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE"] = 1; + values[valuesById[2] = "IAM_POLICY"] = 2; + values[valuesById[4] = "ORG_POLICY"] = 4; + values[valuesById[5] = "ACCESS_POLICY"] = 5; + values[valuesById[7] = "RELATIONSHIP"] = 7; + return values; + })(); + + v1p7beta1.Asset = (function() { + + /** + * Properties of an Asset. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IAsset + * @property {google.protobuf.ITimestamp|null} [updateTime] Asset updateTime + * @property {string|null} [name] Asset name + * @property {string|null} [assetType] Asset assetType + * @property {google.cloud.asset.v1p7beta1.IResource|null} [resource] Asset resource + * @property {google.iam.v1.IPolicy|null} [iamPolicy] Asset iamPolicy + * @property {Array.|null} [orgPolicy] Asset orgPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessPolicy|null} [accessPolicy] Asset accessPolicy + * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel + * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter + * @property {google.cloud.asset.v1p7beta1.IRelatedAssets|null} [relatedAssets] Asset relatedAssets + * @property {Array.|null} [ancestors] Asset ancestors + */ + + /** + * Constructs a new Asset. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents an Asset. + * @implements IAsset + * @constructor + * @param {google.cloud.asset.v1p7beta1.IAsset=} [properties] Properties to set + */ + function Asset(properties) { + this.orgPolicy = []; + this.ancestors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Asset updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.updateTime = null; + + /** + * Asset name. + * @member {string} name + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.name = ""; + + /** + * Asset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.assetType = ""; + + /** + * Asset resource. + * @member {google.cloud.asset.v1p7beta1.IResource|null|undefined} resource + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.resource = null; + + /** + * Asset iamPolicy. + * @member {google.iam.v1.IPolicy|null|undefined} iamPolicy + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.iamPolicy = null; + + /** + * Asset orgPolicy. + * @member {Array.} orgPolicy + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.orgPolicy = $util.emptyArray; + + /** + * Asset accessPolicy. + * @member {google.identity.accesscontextmanager.v1.IAccessPolicy|null|undefined} accessPolicy + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.accessPolicy = null; + + /** + * Asset accessLevel. + * @member {google.identity.accesscontextmanager.v1.IAccessLevel|null|undefined} accessLevel + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.accessLevel = null; + + /** + * Asset servicePerimeter. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeter|null|undefined} servicePerimeter + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.servicePerimeter = null; + + /** + * Asset relatedAssets. + * @member {google.cloud.asset.v1p7beta1.IRelatedAssets|null|undefined} relatedAssets + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.relatedAssets = null; + + /** + * Asset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Asset.prototype.ancestors = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Asset accessContextPolicy. + * @member {"accessPolicy"|"accessLevel"|"servicePerimeter"|undefined} accessContextPolicy + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + */ + Object.defineProperty(Asset.prototype, "accessContextPolicy", { + get: $util.oneOfGetter($oneOfFields = ["accessPolicy", "accessLevel", "servicePerimeter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Asset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {google.cloud.asset.v1p7beta1.IAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.Asset} Asset instance + */ + Asset.create = function create(properties) { + return new Asset(properties); + }; + + /** + * Encodes the specified Asset message. Does not implicitly {@link google.cloud.asset.v1p7beta1.Asset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {google.cloud.asset.v1p7beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + $root.google.cloud.asset.v1p7beta1.Resource.encode(message.resource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.iam.v1.Policy.encode(message.iamPolicy, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.orgPolicy != null && message.orgPolicy.length) + for (var i = 0; i < message.orgPolicy.length; ++i) + $root.google.cloud.orgpolicy.v1.Policy.encode(message.orgPolicy[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.accessPolicy != null && Object.hasOwnProperty.call(message, "accessPolicy")) + $root.google.identity.accesscontextmanager.v1.AccessPolicy.encode(message.accessPolicy, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + $root.google.identity.accesscontextmanager.v1.AccessLevel.encode(message.accessLevel, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.servicePerimeter != null && Object.hasOwnProperty.call(message, "servicePerimeter")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeter.encode(message.servicePerimeter, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.ancestors[i]); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.relatedAssets != null && Object.hasOwnProperty.call(message, "relatedAssets")) + $root.google.cloud.asset.v1p7beta1.RelatedAssets.encode(message.relatedAssets, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.Asset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {google.cloud.asset.v1p7beta1.IAsset} message Asset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Asset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1p7beta1.Asset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + message.resource = $root.google.cloud.asset.v1p7beta1.Resource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.iamPolicy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.orgPolicy && message.orgPolicy.length)) + message.orgPolicy = []; + message.orgPolicy.push($root.google.cloud.orgpolicy.v1.Policy.decode(reader, reader.uint32())); + break; + } + case 7: { + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.decode(reader, reader.uint32()); + break; + } + case 8: { + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.decode(reader, reader.uint32()); + break; + } + case 9: { + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.decode(reader, reader.uint32()); + break; + } + case 13: { + message.relatedAssets = $root.google.cloud.asset.v1p7beta1.RelatedAssets.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.Asset} Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Asset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Asset message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Asset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) { + var error = $root.google.cloud.asset.v1p7beta1.Resource.verify(message.resource); + if (error) + return "resource." + error; + } + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.iam.v1.Policy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + if (message.orgPolicy != null && message.hasOwnProperty("orgPolicy")) { + if (!Array.isArray(message.orgPolicy)) + return "orgPolicy: array expected"; + for (var i = 0; i < message.orgPolicy.length; ++i) { + var error = $root.google.cloud.orgpolicy.v1.Policy.verify(message.orgPolicy[i]); + if (error) + return "orgPolicy." + error; + } + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessPolicy.verify(message.accessPolicy); + if (error) + return "accessPolicy." + error; + } + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.AccessLevel.verify(message.accessLevel); + if (error) + return "accessLevel." + error; + } + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + if (properties.accessContextPolicy === 1) + return "accessContextPolicy: multiple values"; + properties.accessContextPolicy = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.verify(message.servicePerimeter); + if (error) + return "servicePerimeter." + error; + } + } + if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) { + var error = $root.google.cloud.asset.v1p7beta1.RelatedAssets.verify(message.relatedAssets); + if (error) + return "relatedAssets." + error; + } + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.Asset} Asset + */ + Asset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.Asset) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.Asset(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.name != null) + message.name = String(object.name); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.resource != null) { + if (typeof object.resource !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.resource: object expected"); + message.resource = $root.google.cloud.asset.v1p7beta1.Resource.fromObject(object.resource); + } + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.iamPolicy: object expected"); + message.iamPolicy = $root.google.iam.v1.Policy.fromObject(object.iamPolicy); + } + if (object.orgPolicy) { + if (!Array.isArray(object.orgPolicy)) + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.orgPolicy: array expected"); + message.orgPolicy = []; + for (var i = 0; i < object.orgPolicy.length; ++i) { + if (typeof object.orgPolicy[i] !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.orgPolicy: object expected"); + message.orgPolicy[i] = $root.google.cloud.orgpolicy.v1.Policy.fromObject(object.orgPolicy[i]); + } + } + if (object.accessPolicy != null) { + if (typeof object.accessPolicy !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.accessPolicy: object expected"); + message.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.fromObject(object.accessPolicy); + } + if (object.accessLevel != null) { + if (typeof object.accessLevel !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.accessLevel: object expected"); + message.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.fromObject(object.accessLevel); + } + if (object.servicePerimeter != null) { + if (typeof object.servicePerimeter !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.servicePerimeter: object expected"); + message.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.fromObject(object.servicePerimeter); + } + if (object.relatedAssets != null) { + if (typeof object.relatedAssets !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.relatedAssets: object expected"); + message.relatedAssets = $root.google.cloud.asset.v1p7beta1.RelatedAssets.fromObject(object.relatedAssets); + } + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p7beta1.Asset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {google.cloud.asset.v1p7beta1.Asset} message Asset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Asset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.orgPolicy = []; + object.ancestors = []; + } + if (options.defaults) { + object.name = ""; + object.assetType = ""; + object.resource = null; + object.iamPolicy = null; + object.updateTime = null; + object.relatedAssets = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = $root.google.cloud.asset.v1p7beta1.Resource.toObject(message.resource, options); + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.iam.v1.Policy.toObject(message.iamPolicy, options); + if (message.orgPolicy && message.orgPolicy.length) { + object.orgPolicy = []; + for (var j = 0; j < message.orgPolicy.length; ++j) + object.orgPolicy[j] = $root.google.cloud.orgpolicy.v1.Policy.toObject(message.orgPolicy[j], options); + } + if (message.accessPolicy != null && message.hasOwnProperty("accessPolicy")) { + object.accessPolicy = $root.google.identity.accesscontextmanager.v1.AccessPolicy.toObject(message.accessPolicy, options); + if (options.oneofs) + object.accessContextPolicy = "accessPolicy"; + } + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = $root.google.identity.accesscontextmanager.v1.AccessLevel.toObject(message.accessLevel, options); + if (options.oneofs) + object.accessContextPolicy = "accessLevel"; + } + if (message.servicePerimeter != null && message.hasOwnProperty("servicePerimeter")) { + object.servicePerimeter = $root.google.identity.accesscontextmanager.v1.ServicePerimeter.toObject(message.servicePerimeter, options); + if (options.oneofs) + object.accessContextPolicy = "servicePerimeter"; + } + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) + object.relatedAssets = $root.google.cloud.asset.v1p7beta1.RelatedAssets.toObject(message.relatedAssets, options); + return object; + }; + + /** + * Converts this Asset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.Asset + * @instance + * @returns {Object.} JSON object + */ + Asset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Asset + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.Asset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Asset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.Asset"; + }; + + return Asset; + })(); + + v1p7beta1.Resource = (function() { + + /** + * Properties of a Resource. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IResource + * @property {string|null} [version] Resource version + * @property {string|null} [discoveryDocumentUri] Resource discoveryDocumentUri + * @property {string|null} [discoveryName] Resource discoveryName + * @property {string|null} [resourceUrl] Resource resourceUrl + * @property {string|null} [parent] Resource parent + * @property {google.protobuf.IStruct|null} [data] Resource data + * @property {string|null} [location] Resource location + */ + + /** + * Constructs a new Resource. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents a Resource. + * @implements IResource + * @constructor + * @param {google.cloud.asset.v1p7beta1.IResource=} [properties] Properties to set + */ + function Resource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Resource version. + * @member {string} version + * @memberof google.cloud.asset.v1p7beta1.Resource + * @instance + */ + Resource.prototype.version = ""; + + /** + * Resource discoveryDocumentUri. + * @member {string} discoveryDocumentUri + * @memberof google.cloud.asset.v1p7beta1.Resource + * @instance + */ + Resource.prototype.discoveryDocumentUri = ""; + + /** + * Resource discoveryName. + * @member {string} discoveryName + * @memberof google.cloud.asset.v1p7beta1.Resource + * @instance + */ + Resource.prototype.discoveryName = ""; + + /** + * Resource resourceUrl. + * @member {string} resourceUrl + * @memberof google.cloud.asset.v1p7beta1.Resource + * @instance + */ + Resource.prototype.resourceUrl = ""; + + /** + * Resource parent. + * @member {string} parent + * @memberof google.cloud.asset.v1p7beta1.Resource + * @instance + */ + Resource.prototype.parent = ""; + + /** + * Resource data. + * @member {google.protobuf.IStruct|null|undefined} data + * @memberof google.cloud.asset.v1p7beta1.Resource + * @instance + */ + Resource.prototype.data = null; + + /** + * Resource location. + * @member {string} location + * @memberof google.cloud.asset.v1p7beta1.Resource + * @instance + */ + Resource.prototype.location = ""; + + /** + * Creates a new Resource instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.Resource + * @static + * @param {google.cloud.asset.v1p7beta1.IResource=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.Resource} Resource instance + */ + Resource.create = function create(properties) { + return new Resource(properties); + }; + + /** + * Encodes the specified Resource message. Does not implicitly {@link google.cloud.asset.v1p7beta1.Resource.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.Resource + * @static + * @param {google.cloud.asset.v1p7beta1.IResource} message Resource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Resource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.discoveryDocumentUri != null && Object.hasOwnProperty.call(message, "discoveryDocumentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.discoveryDocumentUri); + if (message.discoveryName != null && Object.hasOwnProperty.call(message, "discoveryName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.discoveryName); + if (message.resourceUrl != null && Object.hasOwnProperty.call(message, "resourceUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.resourceUrl); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.parent); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.protobuf.Struct.encode(message.data, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.location); + return writer; + }; + + /** + * Encodes the specified Resource message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.Resource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.Resource + * @static + * @param {google.cloud.asset.v1p7beta1.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.v1p7beta1.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.v1p7beta1.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.v1p7beta1.Resource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.discoveryDocumentUri = reader.string(); + break; + } + case 3: { + message.discoveryName = reader.string(); + break; + } + case 4: { + message.resourceUrl = reader.string(); + break; + } + case 5: { + message.parent = reader.string(); + break; + } + case 6: { + message.data = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 8: { + message.location = reader.string(); + 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.v1p7beta1.Resource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.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.v1p7beta1.Resource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Resource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + if (!$util.isString(message.discoveryDocumentUri)) + return "discoveryDocumentUri: string expected"; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + if (!$util.isString(message.discoveryName)) + return "discoveryName: string expected"; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + if (!$util.isString(message.resourceUrl)) + return "resourceUrl: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.data != null && message.hasOwnProperty("data")) { + var error = $root.google.protobuf.Struct.verify(message.data); + if (error) + return "data." + error; + } + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Resource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.Resource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.Resource} Resource + */ + Resource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.Resource) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.Resource(); + if (object.version != null) + message.version = String(object.version); + if (object.discoveryDocumentUri != null) + message.discoveryDocumentUri = String(object.discoveryDocumentUri); + if (object.discoveryName != null) + message.discoveryName = String(object.discoveryName); + if (object.resourceUrl != null) + message.resourceUrl = String(object.resourceUrl); + if (object.parent != null) + message.parent = String(object.parent); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.Resource.data: object expected"); + message.data = $root.google.protobuf.Struct.fromObject(object.data); + } + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from a Resource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.Resource + * @static + * @param {google.cloud.asset.v1p7beta1.Resource} message Resource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Resource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.discoveryDocumentUri = ""; + object.discoveryName = ""; + object.resourceUrl = ""; + object.parent = ""; + object.data = null; + object.location = ""; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.discoveryDocumentUri != null && message.hasOwnProperty("discoveryDocumentUri")) + object.discoveryDocumentUri = message.discoveryDocumentUri; + if (message.discoveryName != null && message.hasOwnProperty("discoveryName")) + object.discoveryName = message.discoveryName; + if (message.resourceUrl != null && message.hasOwnProperty("resourceUrl")) + object.resourceUrl = message.resourceUrl; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.protobuf.Struct.toObject(message.data, options); + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Resource to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.Resource + * @instance + * @returns {Object.} JSON object + */ + Resource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Resource + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.Resource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Resource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.Resource"; + }; + + return Resource; + })(); + + v1p7beta1.RelatedAssets = (function() { + + /** + * Properties of a RelatedAssets. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IRelatedAssets + * @property {google.cloud.asset.v1p7beta1.IRelationshipAttributes|null} [relationshipAttributes] RelatedAssets relationshipAttributes + * @property {Array.|null} [assets] RelatedAssets assets + */ + + /** + * Constructs a new RelatedAssets. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents a RelatedAssets. + * @implements IRelatedAssets + * @constructor + * @param {google.cloud.asset.v1p7beta1.IRelatedAssets=} [properties] Properties to set + */ + function RelatedAssets(properties) { + this.assets = []; + 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]]; + } + + /** + * RelatedAssets relationshipAttributes. + * @member {google.cloud.asset.v1p7beta1.IRelationshipAttributes|null|undefined} relationshipAttributes + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @instance + */ + RelatedAssets.prototype.relationshipAttributes = null; + + /** + * RelatedAssets assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @instance + */ + RelatedAssets.prototype.assets = $util.emptyArray; + + /** + * Creates a new RelatedAssets instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {google.cloud.asset.v1p7beta1.IRelatedAssets=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.RelatedAssets} RelatedAssets instance + */ + RelatedAssets.create = function create(properties) { + return new RelatedAssets(properties); + }; + + /** + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelatedAssets.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {google.cloud.asset.v1p7beta1.IRelatedAssets} message RelatedAssets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAssets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relationshipAttributes != null && Object.hasOwnProperty.call(message, "relationshipAttributes")) + $root.google.cloud.asset.v1p7beta1.RelationshipAttributes.encode(message.relationshipAttributes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1p7beta1.RelatedAsset.encode(message.assets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelatedAssets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {google.cloud.asset.v1p7beta1.IRelatedAssets} message RelatedAssets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAssets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.RelatedAssets} RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAssets.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.v1p7beta1.RelatedAssets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.relationshipAttributes = $root.google.cloud.asset.v1p7beta1.RelationshipAttributes.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1p7beta1.RelatedAsset.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.RelatedAssets} RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAssets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAssets message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAssets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relationshipAttributes != null && message.hasOwnProperty("relationshipAttributes")) { + var error = $root.google.cloud.asset.v1p7beta1.RelationshipAttributes.verify(message.relationshipAttributes); + if (error) + return "relationshipAttributes." + error; + } + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1p7beta1.RelatedAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.RelatedAssets} RelatedAssets + */ + RelatedAssets.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.RelatedAssets) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.RelatedAssets(); + if (object.relationshipAttributes != null) { + if (typeof object.relationshipAttributes !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.RelatedAssets.relationshipAttributes: object expected"); + message.relationshipAttributes = $root.google.cloud.asset.v1p7beta1.RelationshipAttributes.fromObject(object.relationshipAttributes); + } + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1p7beta1.RelatedAssets.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1p7beta1.RelatedAssets.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1p7beta1.RelatedAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {google.cloud.asset.v1p7beta1.RelatedAssets} message RelatedAssets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAssets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) + object.relationshipAttributes = null; + if (message.relationshipAttributes != null && message.hasOwnProperty("relationshipAttributes")) + object.relationshipAttributes = $root.google.cloud.asset.v1p7beta1.RelationshipAttributes.toObject(message.relationshipAttributes, options); + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1p7beta1.RelatedAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this RelatedAssets to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @instance + * @returns {Object.} JSON object + */ + RelatedAssets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelatedAssets + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.RelatedAssets + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedAssets.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.RelatedAssets"; + }; + + return RelatedAssets; + })(); + + v1p7beta1.RelationshipAttributes = (function() { + + /** + * Properties of a RelationshipAttributes. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IRelationshipAttributes + * @property {string|null} [type] RelationshipAttributes type + * @property {string|null} [sourceResourceType] RelationshipAttributes sourceResourceType + * @property {string|null} [targetResourceType] RelationshipAttributes targetResourceType + * @property {string|null} [action] RelationshipAttributes action + */ + + /** + * Constructs a new RelationshipAttributes. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents a RelationshipAttributes. + * @implements IRelationshipAttributes + * @constructor + * @param {google.cloud.asset.v1p7beta1.IRelationshipAttributes=} [properties] Properties to set + */ + function RelationshipAttributes(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]]; + } + + /** + * RelationshipAttributes type. + * @member {string} type + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.type = ""; + + /** + * RelationshipAttributes sourceResourceType. + * @member {string} sourceResourceType + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.sourceResourceType = ""; + + /** + * RelationshipAttributes targetResourceType. + * @member {string} targetResourceType + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.targetResourceType = ""; + + /** + * RelationshipAttributes action. + * @member {string} action + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.action = ""; + + /** + * Creates a new RelationshipAttributes instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1p7beta1.IRelationshipAttributes=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.RelationshipAttributes} RelationshipAttributes instance + */ + RelationshipAttributes.create = function create(properties) { + return new RelationshipAttributes(properties); + }; + + /** + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelationshipAttributes.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1p7beta1.IRelationshipAttributes} message RelationshipAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelationshipAttributes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceResourceType != null && Object.hasOwnProperty.call(message, "sourceResourceType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceResourceType); + if (message.targetResourceType != null && Object.hasOwnProperty.call(message, "targetResourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetResourceType); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + return writer; + }; + + /** + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelationshipAttributes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1p7beta1.IRelationshipAttributes} message RelationshipAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelationshipAttributes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.RelationshipAttributes} RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelationshipAttributes.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.v1p7beta1.RelationshipAttributes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.type = reader.string(); + break; + } + case 1: { + message.sourceResourceType = reader.string(); + break; + } + case 2: { + message.targetResourceType = reader.string(); + break; + } + case 3: { + message.action = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.RelationshipAttributes} RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelationshipAttributes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelationshipAttributes message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelationshipAttributes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.sourceResourceType != null && message.hasOwnProperty("sourceResourceType")) + if (!$util.isString(message.sourceResourceType)) + return "sourceResourceType: string expected"; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + if (!$util.isString(message.targetResourceType)) + return "targetResourceType: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + return null; + }; + + /** + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.RelationshipAttributes} RelationshipAttributes + */ + RelationshipAttributes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.RelationshipAttributes) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.RelationshipAttributes(); + if (object.type != null) + message.type = String(object.type); + if (object.sourceResourceType != null) + message.sourceResourceType = String(object.sourceResourceType); + if (object.targetResourceType != null) + message.targetResourceType = String(object.targetResourceType); + if (object.action != null) + message.action = String(object.action); + return message; + }; + + /** + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1p7beta1.RelationshipAttributes} message RelationshipAttributes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelationshipAttributes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceResourceType = ""; + object.targetResourceType = ""; + object.action = ""; + object.type = ""; + } + if (message.sourceResourceType != null && message.hasOwnProperty("sourceResourceType")) + object.sourceResourceType = message.sourceResourceType; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + object.targetResourceType = message.targetResourceType; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this RelationshipAttributes to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @instance + * @returns {Object.} JSON object + */ + RelationshipAttributes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelationshipAttributes + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.RelationshipAttributes + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelationshipAttributes.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.RelationshipAttributes"; + }; + + return RelationshipAttributes; + })(); + + v1p7beta1.RelatedAsset = (function() { + + /** + * Properties of a RelatedAsset. + * @memberof google.cloud.asset.v1p7beta1 + * @interface IRelatedAsset + * @property {string|null} [asset] RelatedAsset asset + * @property {string|null} [assetType] RelatedAsset assetType + * @property {Array.|null} [ancestors] RelatedAsset ancestors + */ + + /** + * Constructs a new RelatedAsset. + * @memberof google.cloud.asset.v1p7beta1 + * @classdesc Represents a RelatedAsset. + * @implements IRelatedAsset + * @constructor + * @param {google.cloud.asset.v1p7beta1.IRelatedAsset=} [properties] Properties to set + */ + function RelatedAsset(properties) { + this.ancestors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelatedAsset asset. + * @member {string} asset + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.asset = ""; + + /** + * RelatedAsset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.assetType = ""; + + /** + * RelatedAsset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new RelatedAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {google.cloud.asset.v1p7beta1.IRelatedAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1p7beta1.RelatedAsset} RelatedAsset instance + */ + RelatedAsset.create = function create(properties) { + return new RelatedAsset(properties); + }; + + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelatedAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {google.cloud.asset.v1p7beta1.IRelatedAsset} message RelatedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.asset); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1p7beta1.RelatedAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {google.cloud.asset.v1p7beta1.IRelatedAsset} message RelatedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1p7beta1.RelatedAsset} RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAsset.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.v1p7beta1.RelatedAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.asset = reader.string(); + break; + } + case 2: { + message.assetType = reader.string(); + break; + } + case 3: { + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1p7beta1.RelatedAsset} RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAsset message. + * @function verify + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates a RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1p7beta1.RelatedAsset} RelatedAsset + */ + RelatedAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1p7beta1.RelatedAsset) + return object; + var message = new $root.google.cloud.asset.v1p7beta1.RelatedAsset(); + if (object.asset != null) + message.asset = String(object.asset); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1p7beta1.RelatedAsset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {google.cloud.asset.v1p7beta1.RelatedAsset} message RelatedAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.asset = ""; + object.assetType = ""; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this RelatedAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @instance + * @returns {Object.} JSON object + */ + RelatedAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelatedAsset + * @function getTypeUrl + * @memberof google.cloud.asset.v1p7beta1.RelatedAsset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelatedAsset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.asset.v1p7beta1.RelatedAsset"; + }; + + return RelatedAsset; + })(); + + return v1p7beta1; + })(); + + return asset; + })(); + + cloud.orgpolicy = (function() { + + /** + * Namespace orgpolicy. + * @memberof google.cloud + * @namespace + */ + var orgpolicy = {}; + + orgpolicy.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.orgpolicy + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.cloud.orgpolicy.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {string|null} [constraint] Policy constraint + * @property {Uint8Array|null} [etag] Policy etag + * @property {google.protobuf.ITimestamp|null} [updateTime] Policy updateTime + * @property {google.cloud.orgpolicy.v1.Policy.IListPolicy|null} [listPolicy] Policy listPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null} [booleanPolicy] Policy booleanPolicy + * @property {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null} [restoreDefault] Policy restoreDefault + */ + + /** + * Constructs a new Policy. + * @memberof google.cloud.orgpolicy.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + */ + function Policy(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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy constraint. + * @member {string} constraint + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.constraint = ""; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Policy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.updateTime = null; + + /** + * Policy listPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IListPolicy|null|undefined} listPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.listPolicy = null; + + /** + * Policy booleanPolicy. + * @member {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy|null|undefined} booleanPolicy + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.booleanPolicy = null; + + /** + * Policy restoreDefault. + * @member {google.cloud.orgpolicy.v1.Policy.IRestoreDefault|null|undefined} restoreDefault + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Policy.prototype.restoreDefault = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Policy policyType. + * @member {"listPolicy"|"booleanPolicy"|"restoreDefault"|undefined} policyType + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + */ + Object.defineProperty(Policy.prototype, "policyType", { + get: $util.oneOfGetter($oneOfFields = ["listPolicy", "booleanPolicy", "restoreDefault"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.constraint != null && Object.hasOwnProperty.call(message, "constraint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.constraint); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.listPolicy != null && Object.hasOwnProperty.call(message, "listPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.encode(message.listPolicy, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.booleanPolicy != null && Object.hasOwnProperty.call(message, "booleanPolicy")) + $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.encode(message.booleanPolicy, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.restoreDefault != null && Object.hasOwnProperty.call(message, "restoreDefault")) + $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.encode(message.restoreDefault, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.orgpolicy.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + message.constraint = reader.string(); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.decode(reader, reader.uint32()); + break; + } + case 6: { + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.decode(reader, reader.uint32()); + break; + } + case 7: { + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.constraint != null && message.hasOwnProperty("constraint")) + if (!$util.isString(message.constraint)) + return "constraint: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.verify(message.listPolicy); + if (error) + return "listPolicy." + error; + } + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify(message.booleanPolicy); + if (error) + return "booleanPolicy." + error; + } + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + if (properties.policyType === 1) + return "policyType: multiple values"; + properties.policyType = 1; + { + var error = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify(message.restoreDefault); + if (error) + return "restoreDefault." + error; + } + } + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.constraint != null) + message.constraint = String(object.constraint); + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.listPolicy != null) { + if (typeof object.listPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.listPolicy: object expected"); + message.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.fromObject(object.listPolicy); + } + if (object.booleanPolicy != null) { + if (typeof object.booleanPolicy !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.booleanPolicy: object expected"); + message.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.fromObject(object.booleanPolicy); + } + if (object.restoreDefault != null) { + if (typeof object.restoreDefault !== "object") + throw TypeError(".google.cloud.orgpolicy.v1.Policy.restoreDefault: object expected"); + message.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.fromObject(object.restoreDefault); + } + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {google.cloud.orgpolicy.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = 0; + object.constraint = ""; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + object.updateTime = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.constraint != null && message.hasOwnProperty("constraint")) + object.constraint = message.constraint; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.listPolicy != null && message.hasOwnProperty("listPolicy")) { + object.listPolicy = $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.toObject(message.listPolicy, options); + if (options.oneofs) + object.policyType = "listPolicy"; + } + if (message.booleanPolicy != null && message.hasOwnProperty("booleanPolicy")) { + object.booleanPolicy = $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy.toObject(message.booleanPolicy, options); + if (options.oneofs) + object.policyType = "booleanPolicy"; + } + if (message.restoreDefault != null && message.hasOwnProperty("restoreDefault")) { + object.restoreDefault = $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault.toObject(message.restoreDefault, options); + if (options.oneofs) + object.policyType = "restoreDefault"; + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy"; + }; + + Policy.ListPolicy = (function() { + + /** + * Properties of a ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IListPolicy + * @property {Array.|null} [allowedValues] ListPolicy allowedValues + * @property {Array.|null} [deniedValues] ListPolicy deniedValues + * @property {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues|null} [allValues] ListPolicy allValues + * @property {string|null} [suggestedValue] ListPolicy suggestedValue + * @property {boolean|null} [inheritFromParent] ListPolicy inheritFromParent + */ + + /** + * Constructs a new ListPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a ListPolicy. + * @implements IListPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + */ + function ListPolicy(properties) { + this.allowedValues = []; + this.deniedValues = []; + 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]]; + } + + /** + * ListPolicy allowedValues. + * @member {Array.} allowedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allowedValues = $util.emptyArray; + + /** + * ListPolicy deniedValues. + * @member {Array.} deniedValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.deniedValues = $util.emptyArray; + + /** + * ListPolicy allValues. + * @member {google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues} allValues + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.allValues = 0; + + /** + * ListPolicy suggestedValue. + * @member {string} suggestedValue + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.suggestedValue = ""; + + /** + * ListPolicy inheritFromParent. + * @member {boolean} inheritFromParent + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + */ + ListPolicy.prototype.inheritFromParent = false; + + /** + * Creates a new ListPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy instance + */ + ListPolicy.create = function create(properties) { + return new ListPolicy(properties); + }; + + /** + * Encodes the specified ListPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowedValues != null && message.allowedValues.length) + for (var i = 0; i < message.allowedValues.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.allowedValues[i]); + if (message.deniedValues != null && message.deniedValues.length) + for (var i = 0; i < message.deniedValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deniedValues[i]); + if (message.allValues != null && Object.hasOwnProperty.call(message, "allValues")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.allValues); + if (message.suggestedValue != null && Object.hasOwnProperty.call(message, "suggestedValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.suggestedValue); + if (message.inheritFromParent != null && Object.hasOwnProperty.call(message, "inheritFromParent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.inheritFromParent); + return writer; + }; + + /** + * Encodes the specified ListPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.ListPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IListPolicy} message ListPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.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.orgpolicy.v1.Policy.ListPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.allowedValues && message.allowedValues.length)) + message.allowedValues = []; + message.allowedValues.push(reader.string()); + break; + } + case 2: { + if (!(message.deniedValues && message.deniedValues.length)) + message.deniedValues = []; + message.deniedValues.push(reader.string()); + break; + } + case 3: { + message.allValues = reader.int32(); + break; + } + case 4: { + message.suggestedValue = reader.string(); + break; + } + case 5: { + message.inheritFromParent = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowedValues != null && message.hasOwnProperty("allowedValues")) { + if (!Array.isArray(message.allowedValues)) + return "allowedValues: array expected"; + for (var i = 0; i < message.allowedValues.length; ++i) + if (!$util.isString(message.allowedValues[i])) + return "allowedValues: string[] expected"; + } + if (message.deniedValues != null && message.hasOwnProperty("deniedValues")) { + if (!Array.isArray(message.deniedValues)) + return "deniedValues: array expected"; + for (var i = 0; i < message.deniedValues.length; ++i) + if (!$util.isString(message.deniedValues[i])) + return "deniedValues: string[] expected"; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + switch (message.allValues) { + default: + return "allValues: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + if (!$util.isString(message.suggestedValue)) + return "suggestedValue: string expected"; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + if (typeof message.inheritFromParent !== "boolean") + return "inheritFromParent: boolean expected"; + return null; + }; + + /** + * Creates a ListPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.ListPolicy} ListPolicy + */ + ListPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.ListPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.ListPolicy(); + if (object.allowedValues) { + if (!Array.isArray(object.allowedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.allowedValues: array expected"); + message.allowedValues = []; + for (var i = 0; i < object.allowedValues.length; ++i) + message.allowedValues[i] = String(object.allowedValues[i]); + } + if (object.deniedValues) { + if (!Array.isArray(object.deniedValues)) + throw TypeError(".google.cloud.orgpolicy.v1.Policy.ListPolicy.deniedValues: array expected"); + message.deniedValues = []; + for (var i = 0; i < object.deniedValues.length; ++i) + message.deniedValues[i] = String(object.deniedValues[i]); + } + switch (object.allValues) { + default: + if (typeof object.allValues === "number") { + message.allValues = object.allValues; + break; + } + break; + case "ALL_VALUES_UNSPECIFIED": + case 0: + message.allValues = 0; + break; + case "ALLOW": + case 1: + message.allValues = 1; + break; + case "DENY": + case 2: + message.allValues = 2; + break; + } + if (object.suggestedValue != null) + message.suggestedValue = String(object.suggestedValue); + if (object.inheritFromParent != null) + message.inheritFromParent = Boolean(object.inheritFromParent); + return message; + }; + + /** + * Creates a plain object from a ListPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.ListPolicy} message ListPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedValues = []; + object.deniedValues = []; + } + if (options.defaults) { + object.allValues = options.enums === String ? "ALL_VALUES_UNSPECIFIED" : 0; + object.suggestedValue = ""; + object.inheritFromParent = false; + } + if (message.allowedValues && message.allowedValues.length) { + object.allowedValues = []; + for (var j = 0; j < message.allowedValues.length; ++j) + object.allowedValues[j] = message.allowedValues[j]; + } + if (message.deniedValues && message.deniedValues.length) { + object.deniedValues = []; + for (var j = 0; j < message.deniedValues.length; ++j) + object.deniedValues[j] = message.deniedValues[j]; + } + if (message.allValues != null && message.hasOwnProperty("allValues")) + object.allValues = options.enums === String ? $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] === undefined ? message.allValues : $root.google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues[message.allValues] : message.allValues; + if (message.suggestedValue != null && message.hasOwnProperty("suggestedValue")) + object.suggestedValue = message.suggestedValue; + if (message.inheritFromParent != null && message.hasOwnProperty("inheritFromParent")) + object.inheritFromParent = message.inheritFromParent; + return object; + }; + + /** + * Converts this ListPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @instance + * @returns {Object.} JSON object + */ + ListPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.ListPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.ListPolicy"; + }; + + /** + * AllValues enum. + * @name google.cloud.orgpolicy.v1.Policy.ListPolicy.AllValues + * @enum {number} + * @property {number} ALL_VALUES_UNSPECIFIED=0 ALL_VALUES_UNSPECIFIED value + * @property {number} ALLOW=1 ALLOW value + * @property {number} DENY=2 DENY value + */ + ListPolicy.AllValues = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ALL_VALUES_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "DENY"] = 2; + return values; + })(); + + return ListPolicy; + })(); + + Policy.BooleanPolicy = (function() { + + /** + * Properties of a BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IBooleanPolicy + * @property {boolean|null} [enforced] BooleanPolicy enforced + */ + + /** + * Constructs a new BooleanPolicy. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a BooleanPolicy. + * @implements IBooleanPolicy + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + */ + function BooleanPolicy(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]]; + } + + /** + * BooleanPolicy enforced. + * @member {boolean} enforced + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + */ + BooleanPolicy.prototype.enforced = false; + + /** + * Creates a new BooleanPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy instance + */ + BooleanPolicy.create = function create(properties) { + return new BooleanPolicy(properties); + }; + + /** + * Encodes the specified BooleanPolicy message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enforced != null && Object.hasOwnProperty.call(message, "enforced")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enforced); + return writer; + }; + + /** + * Encodes the specified BooleanPolicy message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.BooleanPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IBooleanPolicy} message BooleanPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BooleanPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.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.orgpolicy.v1.Policy.BooleanPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enforced = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BooleanPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BooleanPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BooleanPolicy message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BooleanPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enforced != null && message.hasOwnProperty("enforced")) + if (typeof message.enforced !== "boolean") + return "enforced: boolean expected"; + return null; + }; + + /** + * Creates a BooleanPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} BooleanPolicy + */ + BooleanPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy) + return object; + var message = new $root.google.cloud.orgpolicy.v1.Policy.BooleanPolicy(); + if (object.enforced != null) + message.enforced = Boolean(object.enforced); + return message; + }; + + /** + * Creates a plain object from a BooleanPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {google.cloud.orgpolicy.v1.Policy.BooleanPolicy} message BooleanPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BooleanPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enforced = false; + if (message.enforced != null && message.hasOwnProperty("enforced")) + object.enforced = message.enforced; + return object; + }; + + /** + * Converts this BooleanPolicy to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @instance + * @returns {Object.} JSON object + */ + BooleanPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BooleanPolicy + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.BooleanPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BooleanPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.BooleanPolicy"; + }; + + return BooleanPolicy; + })(); + + Policy.RestoreDefault = (function() { + + /** + * Properties of a RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @interface IRestoreDefault + */ + + /** + * Constructs a new RestoreDefault. + * @memberof google.cloud.orgpolicy.v1.Policy + * @classdesc Represents a RestoreDefault. + * @implements IRestoreDefault + * @constructor + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + */ + function RestoreDefault(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]]; + } + + /** + * Creates a new RestoreDefault instance using the specified properties. + * @function create + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault=} [properties] Properties to set + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault instance + */ + RestoreDefault.create = function create(properties) { + return new RestoreDefault(properties); + }; + + /** + * Encodes the specified RestoreDefault message. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RestoreDefault message, length delimited. Does not implicitly {@link google.cloud.orgpolicy.v1.Policy.RestoreDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.IRestoreDefault} message RestoreDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.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.orgpolicy.v1.Policy.RestoreDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreDefault message. + * @function verify + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RestoreDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.orgpolicy.v1.Policy.RestoreDefault} RestoreDefault + */ + RestoreDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault) + return object; + return new $root.google.cloud.orgpolicy.v1.Policy.RestoreDefault(); + }; + + /** + * Creates a plain object from a RestoreDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {google.cloud.orgpolicy.v1.Policy.RestoreDefault} message RestoreDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDefault.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RestoreDefault to JSON. + * @function toJSON + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @instance + * @returns {Object.} JSON object + */ + RestoreDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDefault + * @function getTypeUrl + * @memberof google.cloud.orgpolicy.v1.Policy.RestoreDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.orgpolicy.v1.Policy.RestoreDefault"; + }; + + return RestoreDefault; + })(); + + return Policy; + })(); + + return v1; + })(); + + return orgpolicy; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + 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]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(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]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + api.CommonLanguageSettings = (function() { + + /** + * Properties of a CommonLanguageSettings. + * @memberof google.api + * @interface ICommonLanguageSettings + * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri + * @property {Array.|null} [destinations] CommonLanguageSettings destinations + */ + + /** + * Constructs a new CommonLanguageSettings. + * @memberof google.api + * @classdesc Represents a CommonLanguageSettings. + * @implements ICommonLanguageSettings + * @constructor + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + */ + function CommonLanguageSettings(properties) { + this.destinations = []; + 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]]; + } + + /** + * CommonLanguageSettings referenceDocsUri. + * @member {string} referenceDocsUri + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.referenceDocsUri = ""; + + /** + * CommonLanguageSettings destinations. + * @member {Array.} destinations + * @memberof google.api.CommonLanguageSettings + * @instance + */ + CommonLanguageSettings.prototype.destinations = $util.emptyArray; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @function create + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance + */ + CommonLanguageSettings.create = function create(properties) { + return new CommonLanguageSettings(properties); + }; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); + if (message.destinations != null && message.destinations.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.destinations.length; ++i) + writer.int32(message.destinations[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.referenceDocsUri = reader.string(); + break; + } + case 2: { + if (!(message.destinations && message.destinations.length)) + message.destinations = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.destinations.push(reader.int32()); + } else + message.destinations.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CommonLanguageSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CommonLanguageSettings message. + * @function verify + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonLanguageSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + if (!$util.isString(message.referenceDocsUri)) + return "referenceDocsUri: string expected"; + if (message.destinations != null && message.hasOwnProperty("destinations")) { + if (!Array.isArray(message.destinations)) + return "destinations: array expected"; + for (var i = 0; i < message.destinations.length; ++i) + switch (message.destinations[i]) { + default: + return "destinations: enum value[] expected"; + case 0: + case 10: + case 20: + break; + } + } + return null; + }; + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings + */ + CommonLanguageSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CommonLanguageSettings) + return object; + var message = new $root.google.api.CommonLanguageSettings(); + if (object.referenceDocsUri != null) + message.referenceDocsUri = String(object.referenceDocsUri); + if (object.destinations) { + if (!Array.isArray(object.destinations)) + throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); + message.destinations = []; + for (var i = 0; i < object.destinations.length; ++i) + switch (object.destinations[i]) { + default: + if (typeof object.destinations[i] === "number") { + message.destinations[i] = object.destinations[i]; + break; + } + case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": + case 0: + message.destinations[i] = 0; + break; + case "GITHUB": + case 10: + message.destinations[i] = 10; + break; + case "PACKAGE_MANAGER": + case 20: + message.destinations[i] = 20; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CommonLanguageSettings + * @static + * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonLanguageSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.destinations = []; + if (options.defaults) + object.referenceDocsUri = ""; + if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) + object.referenceDocsUri = message.referenceDocsUri; + if (message.destinations && message.destinations.length) { + object.destinations = []; + for (var j = 0; j < message.destinations.length; ++j) + object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; + } + return object; + }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @function toJSON + * @memberof google.api.CommonLanguageSettings + * @instance + * @returns {Object.} JSON object + */ + CommonLanguageSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CommonLanguageSettings + * @function getTypeUrl + * @memberof google.api.CommonLanguageSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CommonLanguageSettings"; + }; + + return CommonLanguageSettings; + })(); + + api.ClientLibrarySettings = (function() { + + /** + * Properties of a ClientLibrarySettings. + * @memberof google.api + * @interface IClientLibrarySettings + * @property {string|null} [version] ClientLibrarySettings version + * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage + * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums + * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings + * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings + * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings + * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings + * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings + * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings + * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings + * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings + */ + + /** + * Constructs a new ClientLibrarySettings. + * @memberof google.api + * @classdesc Represents a ClientLibrarySettings. + * @implements IClientLibrarySettings + * @constructor + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + */ + function ClientLibrarySettings(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]]; + } + + /** + * ClientLibrarySettings version. + * @member {string} version + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.version = ""; + + /** + * ClientLibrarySettings launchStage. + * @member {google.api.LaunchStage} launchStage + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.launchStage = 0; + + /** + * ClientLibrarySettings restNumericEnums. + * @member {boolean} restNumericEnums + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.restNumericEnums = false; + + /** + * ClientLibrarySettings javaSettings. + * @member {google.api.IJavaSettings|null|undefined} javaSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.javaSettings = null; + + /** + * ClientLibrarySettings cppSettings. + * @member {google.api.ICppSettings|null|undefined} cppSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.cppSettings = null; + + /** + * ClientLibrarySettings phpSettings. + * @member {google.api.IPhpSettings|null|undefined} phpSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.phpSettings = null; + + /** + * ClientLibrarySettings pythonSettings. + * @member {google.api.IPythonSettings|null|undefined} pythonSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.pythonSettings = null; + + /** + * ClientLibrarySettings nodeSettings. + * @member {google.api.INodeSettings|null|undefined} nodeSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.nodeSettings = null; + + /** + * ClientLibrarySettings dotnetSettings. + * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.dotnetSettings = null; + + /** + * ClientLibrarySettings rubySettings. + * @member {google.api.IRubySettings|null|undefined} rubySettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.rubySettings = null; + + /** + * ClientLibrarySettings goSettings. + * @member {google.api.IGoSettings|null|undefined} goSettings + * @memberof google.api.ClientLibrarySettings + * @instance + */ + ClientLibrarySettings.prototype.goSettings = null; + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @function create + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings=} [properties] Properties to set + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance + */ + ClientLibrarySettings.create = function create(properties) { + return new ClientLibrarySettings(properties); + }; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); + if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); + if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); + if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) + $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) + $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) + $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) + $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) + $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) + $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) + $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) + $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.string(); + break; + } + case 2: { + message.launchStage = reader.int32(); + break; + } + case 3: { + message.restNumericEnums = reader.bool(); + break; + } + case 21: { + message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32()); + break; + } + case 22: { + message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32()); + break; + } + case 23: { + message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32()); + break; + } + case 24: { + message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32()); + break; + } + case 25: { + message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32()); + break; + } + case 27: { + message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32()); + break; + } + case 28: { + message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ClientLibrarySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientLibrarySettings message. + * @function verify + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientLibrarySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + switch (message.launchStage) { + default: + return "launchStage: enum value expected"; + case 0: + case 6: + case 7: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + if (typeof message.restNumericEnums !== "boolean") + return "restNumericEnums: boolean expected"; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { + var error = $root.google.api.JavaSettings.verify(message.javaSettings); + if (error) + return "javaSettings." + error; + } + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { + var error = $root.google.api.CppSettings.verify(message.cppSettings); + if (error) + return "cppSettings." + error; + } + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { + var error = $root.google.api.PhpSettings.verify(message.phpSettings); + if (error) + return "phpSettings." + error; + } + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { + var error = $root.google.api.PythonSettings.verify(message.pythonSettings); + if (error) + return "pythonSettings." + error; + } + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { + var error = $root.google.api.NodeSettings.verify(message.nodeSettings); + if (error) + return "nodeSettings." + error; + } + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { + var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings); + if (error) + return "dotnetSettings." + error; + } + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { + var error = $root.google.api.RubySettings.verify(message.rubySettings); + if (error) + return "rubySettings." + error; + } + if (message.goSettings != null && message.hasOwnProperty("goSettings")) { + var error = $root.google.api.GoSettings.verify(message.goSettings); + if (error) + return "goSettings." + error; + } + return null; + }; + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings + */ + ClientLibrarySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ClientLibrarySettings) + return object; + var message = new $root.google.api.ClientLibrarySettings(); + if (object.version != null) + message.version = String(object.version); + switch (object.launchStage) { + default: + if (typeof object.launchStage === "number") { + message.launchStage = object.launchStage; + break; + } + break; + case "LAUNCH_STAGE_UNSPECIFIED": + case 0: + message.launchStage = 0; + break; + case "UNIMPLEMENTED": + case 6: + message.launchStage = 6; + break; + case "PRELAUNCH": + case 7: + message.launchStage = 7; + break; + case "EARLY_ACCESS": + case 1: + message.launchStage = 1; + break; + case "ALPHA": + case 2: + message.launchStage = 2; + break; + case "BETA": + case 3: + message.launchStage = 3; + break; + case "GA": + case 4: + message.launchStage = 4; + break; + case "DEPRECATED": + case 5: + message.launchStage = 5; + break; + } + if (object.restNumericEnums != null) + message.restNumericEnums = Boolean(object.restNumericEnums); + if (object.javaSettings != null) { + if (typeof object.javaSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); + message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings); + } + if (object.cppSettings != null) { + if (typeof object.cppSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); + message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings); + } + if (object.phpSettings != null) { + if (typeof object.phpSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); + message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings); + } + if (object.pythonSettings != null) { + if (typeof object.pythonSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); + message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings); + } + if (object.nodeSettings != null) { + if (typeof object.nodeSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); + message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings); + } + if (object.dotnetSettings != null) { + if (typeof object.dotnetSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); + message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings); + } + if (object.rubySettings != null) { + if (typeof object.rubySettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); + message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings); + } + if (object.goSettings != null) { + if (typeof object.goSettings !== "object") + throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); + message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings); + } + return message; + }; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ClientLibrarySettings + * @static + * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientLibrarySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.version = ""; + object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; + object.restNumericEnums = false; + object.javaSettings = null; + object.cppSettings = null; + object.phpSettings = null; + object.pythonSettings = null; + object.nodeSettings = null; + object.dotnetSettings = null; + object.rubySettings = null; + object.goSettings = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.launchStage != null && message.hasOwnProperty("launchStage")) + object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; + if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) + object.restNumericEnums = message.restNumericEnums; + if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) + object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); + if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) + object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); + if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) + object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); + if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) + object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); + if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) + object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); + if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) + object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); + if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) + object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); + if (message.goSettings != null && message.hasOwnProperty("goSettings")) + object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); + return object; + }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @function toJSON + * @memberof google.api.ClientLibrarySettings + * @instance + * @returns {Object.} JSON object + */ + ClientLibrarySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientLibrarySettings + * @function getTypeUrl + * @memberof google.api.ClientLibrarySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ClientLibrarySettings"; + }; + + return ClientLibrarySettings; + })(); + + api.Publishing = (function() { + + /** + * Properties of a Publishing. + * @memberof google.api + * @interface IPublishing + * @property {Array.|null} [methodSettings] Publishing methodSettings + * @property {string|null} [newIssueUri] Publishing newIssueUri + * @property {string|null} [documentationUri] Publishing documentationUri + * @property {string|null} [apiShortName] Publishing apiShortName + * @property {string|null} [githubLabel] Publishing githubLabel + * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams + * @property {string|null} [docTagPrefix] Publishing docTagPrefix + * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization + * @property {Array.|null} [librarySettings] Publishing librarySettings + * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri + * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri + */ + + /** + * Constructs a new Publishing. + * @memberof google.api + * @classdesc Represents a Publishing. + * @implements IPublishing + * @constructor + * @param {google.api.IPublishing=} [properties] Properties to set + */ + function Publishing(properties) { + this.methodSettings = []; + this.codeownerGithubTeams = []; + this.librarySettings = []; + 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]]; + } + + /** + * Publishing methodSettings. + * @member {Array.} methodSettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.methodSettings = $util.emptyArray; + + /** + * Publishing newIssueUri. + * @member {string} newIssueUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.newIssueUri = ""; + + /** + * Publishing documentationUri. + * @member {string} documentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.documentationUri = ""; + + /** + * Publishing apiShortName. + * @member {string} apiShortName + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.apiShortName = ""; + + /** + * Publishing githubLabel. + * @member {string} githubLabel + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.githubLabel = ""; + + /** + * Publishing codeownerGithubTeams. + * @member {Array.} codeownerGithubTeams + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.codeownerGithubTeams = $util.emptyArray; + + /** + * Publishing docTagPrefix. + * @member {string} docTagPrefix + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.docTagPrefix = ""; + + /** + * Publishing organization. + * @member {google.api.ClientLibraryOrganization} organization + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.organization = 0; + + /** + * Publishing librarySettings. + * @member {Array.} librarySettings + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.librarySettings = $util.emptyArray; + + /** + * Publishing protoReferenceDocumentationUri. + * @member {string} protoReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.protoReferenceDocumentationUri = ""; + + /** + * Publishing restReferenceDocumentationUri. + * @member {string} restReferenceDocumentationUri + * @memberof google.api.Publishing + * @instance + */ + Publishing.prototype.restReferenceDocumentationUri = ""; + + /** + * Creates a new Publishing instance using the specified properties. + * @function create + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing=} [properties] Properties to set + * @returns {google.api.Publishing} Publishing instance + */ + Publishing.create = function create(properties) { + return new Publishing(properties); + }; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encode + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.methodSettings != null && message.methodSettings.length) + for (var i = 0; i < message.methodSettings.length; ++i) + $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) + writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); + if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) + writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); + if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) + writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); + if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) + writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); + if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); + if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) + writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); + if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) + writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); + if (message.librarySettings != null && message.librarySettings.length) + for (var i = 0; i < message.librarySettings.length; ++i) + $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); + if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) + writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); + if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) + writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); + return writer; + }; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Publishing + * @static + * @param {google.api.IPublishing} message Publishing message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Publishing.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @function decode + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.methodSettings && message.methodSettings.length)) + message.methodSettings = []; + message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32())); + break; + } + case 101: { + message.newIssueUri = reader.string(); + break; + } + case 102: { + message.documentationUri = reader.string(); + break; + } + case 103: { + message.apiShortName = reader.string(); + break; + } + case 104: { + message.githubLabel = reader.string(); + break; + } + case 105: { + if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) + message.codeownerGithubTeams = []; + message.codeownerGithubTeams.push(reader.string()); + break; + } + case 106: { + message.docTagPrefix = reader.string(); + break; + } + case 107: { + message.organization = reader.int32(); + break; + } + case 109: { + if (!(message.librarySettings && message.librarySettings.length)) + message.librarySettings = []; + message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32())); + break; + } + case 110: { + message.protoReferenceDocumentationUri = reader.string(); + break; + } + case 111: { + message.restReferenceDocumentationUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Publishing + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Publishing} Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Publishing.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Publishing message. + * @function verify + * @memberof google.api.Publishing + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Publishing.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { + if (!Array.isArray(message.methodSettings)) + return "methodSettings: array expected"; + for (var i = 0; i < message.methodSettings.length; ++i) { + var error = $root.google.api.MethodSettings.verify(message.methodSettings[i]); + if (error) + return "methodSettings." + error; + } + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + if (!$util.isString(message.newIssueUri)) + return "newIssueUri: string expected"; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + if (!$util.isString(message.documentationUri)) + return "documentationUri: string expected"; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + if (!$util.isString(message.apiShortName)) + return "apiShortName: string expected"; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + if (!$util.isString(message.githubLabel)) + return "githubLabel: string expected"; + if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { + if (!Array.isArray(message.codeownerGithubTeams)) + return "codeownerGithubTeams: array expected"; + for (var i = 0; i < message.codeownerGithubTeams.length; ++i) + if (!$util.isString(message.codeownerGithubTeams[i])) + return "codeownerGithubTeams: string[] expected"; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + if (!$util.isString(message.docTagPrefix)) + return "docTagPrefix: string expected"; + if (message.organization != null && message.hasOwnProperty("organization")) + switch (message.organization) { + default: + return "organization: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { + if (!Array.isArray(message.librarySettings)) + return "librarySettings: array expected"; + for (var i = 0; i < message.librarySettings.length; ++i) { + var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i]); + if (error) + return "librarySettings." + error; + } + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + if (!$util.isString(message.protoReferenceDocumentationUri)) + return "protoReferenceDocumentationUri: string expected"; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + if (!$util.isString(message.restReferenceDocumentationUri)) + return "restReferenceDocumentationUri: string expected"; + return null; + }; + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Publishing + * @static + * @param {Object.} object Plain object + * @returns {google.api.Publishing} Publishing + */ + Publishing.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Publishing) + return object; + var message = new $root.google.api.Publishing(); + if (object.methodSettings) { + if (!Array.isArray(object.methodSettings)) + throw TypeError(".google.api.Publishing.methodSettings: array expected"); + message.methodSettings = []; + for (var i = 0; i < object.methodSettings.length; ++i) { + if (typeof object.methodSettings[i] !== "object") + throw TypeError(".google.api.Publishing.methodSettings: object expected"); + message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i]); + } + } + if (object.newIssueUri != null) + message.newIssueUri = String(object.newIssueUri); + if (object.documentationUri != null) + message.documentationUri = String(object.documentationUri); + if (object.apiShortName != null) + message.apiShortName = String(object.apiShortName); + if (object.githubLabel != null) + message.githubLabel = String(object.githubLabel); + if (object.codeownerGithubTeams) { + if (!Array.isArray(object.codeownerGithubTeams)) + throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); + message.codeownerGithubTeams = []; + for (var i = 0; i < object.codeownerGithubTeams.length; ++i) + message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); + } + if (object.docTagPrefix != null) + message.docTagPrefix = String(object.docTagPrefix); + switch (object.organization) { + default: + if (typeof object.organization === "number") { + message.organization = object.organization; + break; + } + break; + case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": + case 0: + message.organization = 0; + break; + case "CLOUD": + case 1: + message.organization = 1; + break; + case "ADS": + case 2: + message.organization = 2; + break; + case "PHOTOS": + case 3: + message.organization = 3; + break; + case "STREET_VIEW": + case 4: + message.organization = 4; + break; + case "SHOPPING": + case 5: + message.organization = 5; + break; + case "GEO": + case 6: + message.organization = 6; + break; + case "GENERATIVE_AI": + case 7: + message.organization = 7; + break; + } + if (object.librarySettings) { + if (!Array.isArray(object.librarySettings)) + throw TypeError(".google.api.Publishing.librarySettings: array expected"); + message.librarySettings = []; + for (var i = 0; i < object.librarySettings.length; ++i) { + if (typeof object.librarySettings[i] !== "object") + throw TypeError(".google.api.Publishing.librarySettings: object expected"); + message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i]); + } + } + if (object.protoReferenceDocumentationUri != null) + message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); + if (object.restReferenceDocumentationUri != null) + message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); + return message; + }; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Publishing + * @static + * @param {google.api.Publishing} message Publishing + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Publishing.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.methodSettings = []; + object.codeownerGithubTeams = []; + object.librarySettings = []; + } + if (options.defaults) { + object.newIssueUri = ""; + object.documentationUri = ""; + object.apiShortName = ""; + object.githubLabel = ""; + object.docTagPrefix = ""; + object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; + object.protoReferenceDocumentationUri = ""; + object.restReferenceDocumentationUri = ""; + } + if (message.methodSettings && message.methodSettings.length) { + object.methodSettings = []; + for (var j = 0; j < message.methodSettings.length; ++j) + object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); + } + if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) + object.newIssueUri = message.newIssueUri; + if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) + object.documentationUri = message.documentationUri; + if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) + object.apiShortName = message.apiShortName; + if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) + object.githubLabel = message.githubLabel; + if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { + object.codeownerGithubTeams = []; + for (var j = 0; j < message.codeownerGithubTeams.length; ++j) + object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; + } + if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) + object.docTagPrefix = message.docTagPrefix; + if (message.organization != null && message.hasOwnProperty("organization")) + object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; + if (message.librarySettings && message.librarySettings.length) { + object.librarySettings = []; + for (var j = 0; j < message.librarySettings.length; ++j) + object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); + } + if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) + object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; + if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) + object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; + return object; + }; + + /** + * Converts this Publishing to JSON. + * @function toJSON + * @memberof google.api.Publishing + * @instance + * @returns {Object.} JSON object + */ + Publishing.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Publishing + * @function getTypeUrl + * @memberof google.api.Publishing + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Publishing"; + }; + + return Publishing; + })(); + + api.JavaSettings = (function() { + + /** + * Properties of a JavaSettings. + * @memberof google.api + * @interface IJavaSettings + * @property {string|null} [libraryPackage] JavaSettings libraryPackage + * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames + * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common + */ + + /** + * Constructs a new JavaSettings. + * @memberof google.api + * @classdesc Represents a JavaSettings. + * @implements IJavaSettings + * @constructor + * @param {google.api.IJavaSettings=} [properties] Properties to set + */ + function JavaSettings(properties) { + this.serviceClassNames = {}; + 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]]; + } + + /** + * JavaSettings libraryPackage. + * @member {string} libraryPackage + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.libraryPackage = ""; + + /** + * JavaSettings serviceClassNames. + * @member {Object.} serviceClassNames + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.serviceClassNames = $util.emptyObject; + + /** + * JavaSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.JavaSettings + * @instance + */ + JavaSettings.prototype.common = null; + + /** + * Creates a new JavaSettings instance using the specified properties. + * @function create + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings=} [properties] Properties to set + * @returns {google.api.JavaSettings} JavaSettings instance + */ + JavaSettings.create = function create(properties) { + return new JavaSettings(properties); + }; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encode + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); + if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) + for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.libraryPackage = reader.string(); + break; + } + case 2: { + if (message.serviceClassNames === $util.emptyObject) + message.serviceClassNames = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.serviceClassNames[key] = value; + break; + } + case 3: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.JavaSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.JavaSettings} JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JavaSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JavaSettings message. + * @function verify + * @memberof google.api.JavaSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JavaSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + if (!$util.isString(message.libraryPackage)) + return "libraryPackage: string expected"; + if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { + if (!$util.isObject(message.serviceClassNames)) + return "serviceClassNames: object expected"; + var key = Object.keys(message.serviceClassNames); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.serviceClassNames[key[i]])) + return "serviceClassNames: string{k:string} expected"; + } + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.JavaSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.JavaSettings} JavaSettings + */ + JavaSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.JavaSettings) + return object; + var message = new $root.google.api.JavaSettings(); + if (object.libraryPackage != null) + message.libraryPackage = String(object.libraryPackage); + if (object.serviceClassNames) { + if (typeof object.serviceClassNames !== "object") + throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); + message.serviceClassNames = {}; + for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) + message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); + } + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.JavaSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.JavaSettings + * @static + * @param {google.api.JavaSettings} message JavaSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JavaSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.serviceClassNames = {}; + if (options.defaults) { + object.libraryPackage = ""; + object.common = null; + } + if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) + object.libraryPackage = message.libraryPackage; + var keys2; + if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { + object.serviceClassNames = {}; + for (var j = 0; j < keys2.length; ++j) + object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this JavaSettings to JSON. + * @function toJSON + * @memberof google.api.JavaSettings + * @instance + * @returns {Object.} JSON object + */ + JavaSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JavaSettings + * @function getTypeUrl + * @memberof google.api.JavaSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.JavaSettings"; + }; + + return JavaSettings; + })(); + + api.CppSettings = (function() { + + /** + * Properties of a CppSettings. + * @memberof google.api + * @interface ICppSettings + * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common + */ + + /** + * Constructs a new CppSettings. + * @memberof google.api + * @classdesc Represents a CppSettings. + * @implements ICppSettings + * @constructor + * @param {google.api.ICppSettings=} [properties] Properties to set + */ + function CppSettings(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]]; + } + + /** + * CppSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.CppSettings + * @instance + */ + CppSettings.prototype.common = null; + + /** + * Creates a new CppSettings instance using the specified properties. + * @function create + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings=} [properties] Properties to set + * @returns {google.api.CppSettings} CppSettings instance + */ + CppSettings.create = function create(properties) { + return new CppSettings(properties); + }; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encode + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {google.api.ICppSettings} message CppSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CppSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CppSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CppSettings} CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CppSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CppSettings message. + * @function verify + * @memberof google.api.CppSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CppSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CppSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.CppSettings} CppSettings + */ + CppSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CppSettings) + return object; + var message = new $root.google.api.CppSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.CppSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CppSettings + * @static + * @param {google.api.CppSettings} message CppSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CppSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this CppSettings to JSON. + * @function toJSON + * @memberof google.api.CppSettings + * @instance + * @returns {Object.} JSON object + */ + CppSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CppSettings + * @function getTypeUrl + * @memberof google.api.CppSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CppSettings"; + }; + + return CppSettings; + })(); + + api.PhpSettings = (function() { + + /** + * Properties of a PhpSettings. + * @memberof google.api + * @interface IPhpSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common + */ + + /** + * Constructs a new PhpSettings. + * @memberof google.api + * @classdesc Represents a PhpSettings. + * @implements IPhpSettings + * @constructor + * @param {google.api.IPhpSettings=} [properties] Properties to set + */ + function PhpSettings(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]]; + } + + /** + * PhpSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PhpSettings + * @instance + */ + PhpSettings.prototype.common = null; + + /** + * Creates a new PhpSettings instance using the specified properties. + * @function create + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings=} [properties] Properties to set + * @returns {google.api.PhpSettings} PhpSettings instance + */ + PhpSettings.create = function create(properties) { + return new PhpSettings(properties); + }; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PhpSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PhpSettings} PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhpSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhpSettings message. + * @function verify + * @memberof google.api.PhpSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhpSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PhpSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PhpSettings} PhpSettings + */ + PhpSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PhpSettings) + return object; + var message = new $root.google.api.PhpSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PhpSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PhpSettings + * @static + * @param {google.api.PhpSettings} message PhpSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhpSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PhpSettings to JSON. + * @function toJSON + * @memberof google.api.PhpSettings + * @instance + * @returns {Object.} JSON object + */ + PhpSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PhpSettings + * @function getTypeUrl + * @memberof google.api.PhpSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PhpSettings"; + }; + + return PhpSettings; + })(); + + api.PythonSettings = (function() { + + /** + * Properties of a PythonSettings. + * @memberof google.api + * @interface IPythonSettings + * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common + */ + + /** + * Constructs a new PythonSettings. + * @memberof google.api + * @classdesc Represents a PythonSettings. + * @implements IPythonSettings + * @constructor + * @param {google.api.IPythonSettings=} [properties] Properties to set + */ + function PythonSettings(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]]; + } + + /** + * PythonSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.PythonSettings + * @instance + */ + PythonSettings.prototype.common = null; + + /** + * Creates a new PythonSettings instance using the specified properties. + * @function create + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings=} [properties] Properties to set + * @returns {google.api.PythonSettings} PythonSettings instance + */ + PythonSettings.create = function create(properties) { + return new PythonSettings(properties); + }; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encode + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.PythonSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.PythonSettings} PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PythonSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PythonSettings message. + * @function verify + * @memberof google.api.PythonSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PythonSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.PythonSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.PythonSettings} PythonSettings + */ + PythonSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.PythonSettings) + return object; + var message = new $root.google.api.PythonSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.PythonSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.PythonSettings + * @static + * @param {google.api.PythonSettings} message PythonSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PythonSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this PythonSettings to JSON. + * @function toJSON + * @memberof google.api.PythonSettings + * @instance + * @returns {Object.} JSON object + */ + PythonSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PythonSettings + * @function getTypeUrl + * @memberof google.api.PythonSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.PythonSettings"; + }; + + return PythonSettings; + })(); + + api.NodeSettings = (function() { + + /** + * Properties of a NodeSettings. + * @memberof google.api + * @interface INodeSettings + * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common + */ + + /** + * Constructs a new NodeSettings. + * @memberof google.api + * @classdesc Represents a NodeSettings. + * @implements INodeSettings + * @constructor + * @param {google.api.INodeSettings=} [properties] Properties to set + */ + function NodeSettings(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]]; + } + + /** + * NodeSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.NodeSettings + * @instance + */ + NodeSettings.prototype.common = null; + + /** + * Creates a new NodeSettings instance using the specified properties. + * @function create + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings=} [properties] Properties to set + * @returns {google.api.NodeSettings} NodeSettings instance + */ + NodeSettings.create = function create(properties) { + return new NodeSettings(properties); + }; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encode + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.NodeSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.NodeSettings} NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeSettings message. + * @function verify + * @memberof google.api.NodeSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.NodeSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.NodeSettings} NodeSettings + */ + NodeSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.NodeSettings) + return object; + var message = new $root.google.api.NodeSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.NodeSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.NodeSettings + * @static + * @param {google.api.NodeSettings} message NodeSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this NodeSettings to JSON. + * @function toJSON + * @memberof google.api.NodeSettings + * @instance + * @returns {Object.} JSON object + */ + NodeSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeSettings + * @function getTypeUrl + * @memberof google.api.NodeSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.NodeSettings"; + }; + + return NodeSettings; + })(); + + api.DotnetSettings = (function() { + + /** + * Properties of a DotnetSettings. + * @memberof google.api + * @interface IDotnetSettings + * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common + * @property {Object.|null} [renamedServices] DotnetSettings renamedServices + * @property {Object.|null} [renamedResources] DotnetSettings renamedResources + * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources + * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases + * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures + */ + + /** + * Constructs a new DotnetSettings. + * @memberof google.api + * @classdesc Represents a DotnetSettings. + * @implements IDotnetSettings + * @constructor + * @param {google.api.IDotnetSettings=} [properties] Properties to set + */ + function DotnetSettings(properties) { + this.renamedServices = {}; + this.renamedResources = {}; + this.ignoredResources = []; + this.forcedNamespaceAliases = []; + this.handwrittenSignatures = []; + 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]]; + } + + /** + * DotnetSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.common = null; + + /** + * DotnetSettings renamedServices. + * @member {Object.} renamedServices + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedServices = $util.emptyObject; + + /** + * DotnetSettings renamedResources. + * @member {Object.} renamedResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.renamedResources = $util.emptyObject; + + /** + * DotnetSettings ignoredResources. + * @member {Array.} ignoredResources + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.ignoredResources = $util.emptyArray; + + /** + * DotnetSettings forcedNamespaceAliases. + * @member {Array.} forcedNamespaceAliases + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; + + /** + * DotnetSettings handwrittenSignatures. + * @member {Array.} handwrittenSignatures + * @memberof google.api.DotnetSettings + * @instance + */ + DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @function create + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings=} [properties] Properties to set + * @returns {google.api.DotnetSettings} DotnetSettings instance + */ + DotnetSettings.create = function create(properties) { + return new DotnetSettings(properties); + }; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encode + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) + for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); + if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) + for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); + if (message.ignoredResources != null && message.ignoredResources.length) + for (var i = 0; i < message.ignoredResources.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); + if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); + if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); + return writer; + }; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + if (message.renamedServices === $util.emptyObject) + message.renamedServices = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedServices[key] = value; + break; + } + case 3: { + if (message.renamedResources === $util.emptyObject) + message.renamedResources = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.renamedResources[key] = value; + break; + } + case 4: { + if (!(message.ignoredResources && message.ignoredResources.length)) + message.ignoredResources = []; + message.ignoredResources.push(reader.string()); + break; + } + case 5: { + if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) + message.forcedNamespaceAliases = []; + message.forcedNamespaceAliases.push(reader.string()); + break; + } + case 6: { + if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) + message.handwrittenSignatures = []; + message.handwrittenSignatures.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.DotnetSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.DotnetSettings} DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DotnetSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DotnetSettings message. + * @function verify + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DotnetSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { + if (!$util.isObject(message.renamedServices)) + return "renamedServices: object expected"; + var key = Object.keys(message.renamedServices); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedServices[key[i]])) + return "renamedServices: string{k:string} expected"; + } + if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { + if (!$util.isObject(message.renamedResources)) + return "renamedResources: object expected"; + var key = Object.keys(message.renamedResources); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.renamedResources[key[i]])) + return "renamedResources: string{k:string} expected"; + } + if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { + if (!Array.isArray(message.ignoredResources)) + return "ignoredResources: array expected"; + for (var i = 0; i < message.ignoredResources.length; ++i) + if (!$util.isString(message.ignoredResources[i])) + return "ignoredResources: string[] expected"; + } + if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { + if (!Array.isArray(message.forcedNamespaceAliases)) + return "forcedNamespaceAliases: array expected"; + for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) + if (!$util.isString(message.forcedNamespaceAliases[i])) + return "forcedNamespaceAliases: string[] expected"; + } + if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { + if (!Array.isArray(message.handwrittenSignatures)) + return "handwrittenSignatures: array expected"; + for (var i = 0; i < message.handwrittenSignatures.length; ++i) + if (!$util.isString(message.handwrittenSignatures[i])) + return "handwrittenSignatures: string[] expected"; + } + return null; + }; + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.DotnetSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.DotnetSettings} DotnetSettings + */ + DotnetSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.DotnetSettings) + return object; + var message = new $root.google.api.DotnetSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.DotnetSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + if (object.renamedServices) { + if (typeof object.renamedServices !== "object") + throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); + message.renamedServices = {}; + for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) + message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); + } + if (object.renamedResources) { + if (typeof object.renamedResources !== "object") + throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); + message.renamedResources = {}; + for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) + message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); + } + if (object.ignoredResources) { + if (!Array.isArray(object.ignoredResources)) + throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); + message.ignoredResources = []; + for (var i = 0; i < object.ignoredResources.length; ++i) + message.ignoredResources[i] = String(object.ignoredResources[i]); + } + if (object.forcedNamespaceAliases) { + if (!Array.isArray(object.forcedNamespaceAliases)) + throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); + message.forcedNamespaceAliases = []; + for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) + message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); + } + if (object.handwrittenSignatures) { + if (!Array.isArray(object.handwrittenSignatures)) + throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); + message.handwrittenSignatures = []; + for (var i = 0; i < object.handwrittenSignatures.length; ++i) + message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.DotnetSettings + * @static + * @param {google.api.DotnetSettings} message DotnetSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DotnetSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ignoredResources = []; + object.forcedNamespaceAliases = []; + object.handwrittenSignatures = []; + } + if (options.objects || options.defaults) { + object.renamedServices = {}; + object.renamedResources = {}; + } + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + var keys2; + if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { + object.renamedServices = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; + } + if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { + object.renamedResources = {}; + for (var j = 0; j < keys2.length; ++j) + object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; + } + if (message.ignoredResources && message.ignoredResources.length) { + object.ignoredResources = []; + for (var j = 0; j < message.ignoredResources.length; ++j) + object.ignoredResources[j] = message.ignoredResources[j]; + } + if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { + object.forcedNamespaceAliases = []; + for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) + object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; + } + if (message.handwrittenSignatures && message.handwrittenSignatures.length) { + object.handwrittenSignatures = []; + for (var j = 0; j < message.handwrittenSignatures.length; ++j) + object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; + } + return object; + }; + + /** + * Converts this DotnetSettings to JSON. + * @function toJSON + * @memberof google.api.DotnetSettings + * @instance + * @returns {Object.} JSON object + */ + DotnetSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DotnetSettings + * @function getTypeUrl + * @memberof google.api.DotnetSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.DotnetSettings"; + }; + + return DotnetSettings; + })(); + + api.RubySettings = (function() { + + /** + * Properties of a RubySettings. + * @memberof google.api + * @interface IRubySettings + * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common + */ + + /** + * Constructs a new RubySettings. + * @memberof google.api + * @classdesc Represents a RubySettings. + * @implements IRubySettings + * @constructor + * @param {google.api.IRubySettings=} [properties] Properties to set + */ + function RubySettings(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]]; + } + + /** + * RubySettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.RubySettings + * @instance + */ + RubySettings.prototype.common = null; + + /** + * Creates a new RubySettings instance using the specified properties. + * @function create + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings=} [properties] Properties to set + * @returns {google.api.RubySettings} RubySettings instance + */ + RubySettings.create = function create(properties) { + return new RubySettings(properties); + }; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encode + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {google.api.IRubySettings} message RubySettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RubySettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.RubySettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.RubySettings} RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RubySettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RubySettings message. + * @function verify + * @memberof google.api.RubySettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RubySettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.RubySettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.RubySettings} RubySettings + */ + RubySettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.RubySettings) + return object; + var message = new $root.google.api.RubySettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.RubySettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.RubySettings + * @static + * @param {google.api.RubySettings} message RubySettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RubySettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this RubySettings to JSON. + * @function toJSON + * @memberof google.api.RubySettings + * @instance + * @returns {Object.} JSON object + */ + RubySettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RubySettings + * @function getTypeUrl + * @memberof google.api.RubySettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.RubySettings"; + }; + + return RubySettings; + })(); + + api.GoSettings = (function() { + + /** + * Properties of a GoSettings. + * @memberof google.api + * @interface IGoSettings + * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common + */ + + /** + * Constructs a new GoSettings. + * @memberof google.api + * @classdesc Represents a GoSettings. + * @implements IGoSettings + * @constructor + * @param {google.api.IGoSettings=} [properties] Properties to set + */ + function GoSettings(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]]; + } + + /** + * GoSettings common. + * @member {google.api.ICommonLanguageSettings|null|undefined} common + * @memberof google.api.GoSettings + * @instance + */ + GoSettings.prototype.common = null; + + /** + * Creates a new GoSettings instance using the specified properties. + * @function create + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings=} [properties] Properties to set + * @returns {google.api.GoSettings} GoSettings instance + */ + GoSettings.create = function create(properties) { + return new GoSettings(properties); + }; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encode + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {google.api.IGoSettings} message GoSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.GoSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.GoSettings} GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoSettings message. + * @function verify + * @memberof google.api.GoSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.api.CommonLanguageSettings.verify(message.common); + if (error) + return "common." + error; + } + return null; + }; + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.GoSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.GoSettings} GoSettings + */ + GoSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.GoSettings) + return object; + var message = new $root.google.api.GoSettings(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.api.GoSettings.common: object expected"); + message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common); + } + return message; + }; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.GoSettings + * @static + * @param {google.api.GoSettings} message GoSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.common = null; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); + return object; + }; + + /** + * Converts this GoSettings to JSON. + * @function toJSON + * @memberof google.api.GoSettings + * @instance + * @returns {Object.} JSON object + */ + GoSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoSettings + * @function getTypeUrl + * @memberof google.api.GoSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.GoSettings"; + }; + + return GoSettings; + })(); + + api.MethodSettings = (function() { + + /** + * Properties of a MethodSettings. + * @memberof google.api + * @interface IMethodSettings + * @property {string|null} [selector] MethodSettings selector + * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning + * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields + */ + + /** + * Constructs a new MethodSettings. + * @memberof google.api + * @classdesc Represents a MethodSettings. + * @implements IMethodSettings + * @constructor + * @param {google.api.IMethodSettings=} [properties] Properties to set + */ + function MethodSettings(properties) { + this.autoPopulatedFields = []; + 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]]; + } + + /** + * MethodSettings selector. + * @member {string} selector + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.selector = ""; + + /** + * MethodSettings longRunning. + * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.longRunning = null; + + /** + * MethodSettings autoPopulatedFields. + * @member {Array.} autoPopulatedFields + * @memberof google.api.MethodSettings + * @instance + */ + MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings=} [properties] Properties to set + * @returns {google.api.MethodSettings} MethodSettings instance + */ + MethodSettings.create = function create(properties) { + return new MethodSettings(properties); + }; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) + $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); + return writer; + }; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) + message.autoPopulatedFields = []; + message.autoPopulatedFields.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings} MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSettings message. + * @function verify + * @memberof google.api.MethodSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) { + var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning); + if (error) + return "longRunning." + error; + } + if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { + if (!Array.isArray(message.autoPopulatedFields)) + return "autoPopulatedFields: array expected"; + for (var i = 0; i < message.autoPopulatedFields.length; ++i) + if (!$util.isString(message.autoPopulatedFields[i])) + return "autoPopulatedFields: string[] expected"; + } + return null; + }; + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings} MethodSettings + */ + MethodSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings) + return object; + var message = new $root.google.api.MethodSettings(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.longRunning != null) { + if (typeof object.longRunning !== "object") + throw TypeError(".google.api.MethodSettings.longRunning: object expected"); + message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning); + } + if (object.autoPopulatedFields) { + if (!Array.isArray(object.autoPopulatedFields)) + throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); + message.autoPopulatedFields = []; + for (var i = 0; i < object.autoPopulatedFields.length; ++i) + message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); + } + return message; + }; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings + * @static + * @param {google.api.MethodSettings} message MethodSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoPopulatedFields = []; + if (options.defaults) { + object.selector = ""; + object.longRunning = null; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.longRunning != null && message.hasOwnProperty("longRunning")) + object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); + if (message.autoPopulatedFields && message.autoPopulatedFields.length) { + object.autoPopulatedFields = []; + for (var j = 0; j < message.autoPopulatedFields.length; ++j) + object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; + } + return object; + }; + + /** + * Converts this MethodSettings to JSON. + * @function toJSON + * @memberof google.api.MethodSettings + * @instance + * @returns {Object.} JSON object + */ + MethodSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSettings + * @function getTypeUrl + * @memberof google.api.MethodSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings"; + }; + + MethodSettings.LongRunning = (function() { + + /** + * Properties of a LongRunning. + * @memberof google.api.MethodSettings + * @interface ILongRunning + * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay + * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier + * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay + * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout + */ + + /** + * Constructs a new LongRunning. + * @memberof google.api.MethodSettings + * @classdesc Represents a LongRunning. + * @implements ILongRunning + * @constructor + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + */ + function LongRunning(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]]; + } + + /** + * LongRunning initialPollDelay. + * @member {google.protobuf.IDuration|null|undefined} initialPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.initialPollDelay = null; + + /** + * LongRunning pollDelayMultiplier. + * @member {number} pollDelayMultiplier + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.pollDelayMultiplier = 0; + + /** + * LongRunning maxPollDelay. + * @member {google.protobuf.IDuration|null|undefined} maxPollDelay + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.maxPollDelay = null; + + /** + * LongRunning totalPollTimeout. + * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout + * @memberof google.api.MethodSettings.LongRunning + * @instance + */ + LongRunning.prototype.totalPollTimeout = null; + + /** + * Creates a new LongRunning instance using the specified properties. + * @function create + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set + * @returns {google.api.MethodSettings.LongRunning} LongRunning instance + */ + LongRunning.create = function create(properties) { + return new LongRunning(properties); + }; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) + $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); + if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) + $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) + $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LongRunning.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @function decode + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.pollDelayMultiplier = reader.float(); + break; + } + case 3: { + message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.MethodSettings.LongRunning} LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LongRunning.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LongRunning message. + * @function verify + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LongRunning.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.initialPollDelay); + if (error) + return "initialPollDelay." + error; + } + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + if (typeof message.pollDelayMultiplier !== "number") + return "pollDelayMultiplier: number expected"; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { + var error = $root.google.protobuf.Duration.verify(message.maxPollDelay); + if (error) + return "maxPollDelay." + error; + } + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout); + if (error) + return "totalPollTimeout." + error; + } + return null; + }; + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {Object.} object Plain object + * @returns {google.api.MethodSettings.LongRunning} LongRunning + */ + LongRunning.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.MethodSettings.LongRunning) + return object; + var message = new $root.google.api.MethodSettings.LongRunning(); + if (object.initialPollDelay != null) { + if (typeof object.initialPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); + message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay); + } + if (object.pollDelayMultiplier != null) + message.pollDelayMultiplier = Number(object.pollDelayMultiplier); + if (object.maxPollDelay != null) { + if (typeof object.maxPollDelay !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); + message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay); + } + if (object.totalPollTimeout != null) { + if (typeof object.totalPollTimeout !== "object") + throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); + message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout); + } + return message; + }; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {google.api.MethodSettings.LongRunning} message LongRunning + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LongRunning.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.initialPollDelay = null; + object.pollDelayMultiplier = 0; + object.maxPollDelay = null; + object.totalPollTimeout = null; + } + if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) + object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); + if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) + object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; + if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) + object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); + if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) + object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); + return object; + }; + + /** + * Converts this LongRunning to JSON. + * @function toJSON + * @memberof google.api.MethodSettings.LongRunning + * @instance + * @returns {Object.} JSON object + */ + LongRunning.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LongRunning + * @function getTypeUrl + * @memberof google.api.MethodSettings.LongRunning + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; + }; + + return LongRunning; + })(); + + return MethodSettings; + })(); + + /** + * ClientLibraryOrganization enum. + * @name google.api.ClientLibraryOrganization + * @enum {number} + * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} ADS=2 ADS value + * @property {number} PHOTOS=3 PHOTOS value + * @property {number} STREET_VIEW=4 STREET_VIEW value + * @property {number} SHOPPING=5 SHOPPING value + * @property {number} GEO=6 GEO value + * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value + */ + api.ClientLibraryOrganization = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "ADS"] = 2; + values[valuesById[3] = "PHOTOS"] = 3; + values[valuesById[4] = "STREET_VIEW"] = 4; + values[valuesById[5] = "SHOPPING"] = 5; + values[valuesById[6] = "GEO"] = 6; + values[valuesById[7] = "GENERATIVE_AI"] = 7; + return values; + })(); + + /** + * ClientLibraryDestination enum. + * @name google.api.ClientLibraryDestination + * @enum {number} + * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value + * @property {number} GITHUB=10 GITHUB value + * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value + */ + api.ClientLibraryDestination = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; + values[valuesById[10] = "GITHUB"] = 10; + values[valuesById[20] = "PACKAGE_MANAGER"] = 20; + return values; + })(); + + /** + * LaunchStage enum. + * @name google.api.LaunchStage + * @enum {number} + * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value + * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value + * @property {number} PRELAUNCH=7 PRELAUNCH value + * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value + * @property {number} ALPHA=2 ALPHA value + * @property {number} BETA=3 BETA value + * @property {number} GA=4 GA value + * @property {number} DEPRECATED=5 DEPRECATED value + */ + api.LaunchStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; + values[valuesById[6] = "UNIMPLEMENTED"] = 6; + values[valuesById[7] = "PRELAUNCH"] = 7; + values[valuesById[1] = "EARLY_ACCESS"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "BETA"] = 3; + values[valuesById[4] = "GA"] = 4; + values[valuesById[5] = "DEPRECATED"] = 5; + return values; + })(); + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + 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]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + /** + * Edition enum. + * @name google.protobuf.Edition + * @enum {number} + * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value + * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value + * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value + * @property {number} EDITION_2023=1000 EDITION_2023 value + * @property {number} EDITION_2024=1001 EDITION_2024 value + * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value + * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value + * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value + * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value + * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value + * @property {number} EDITION_MAX=2147483647 EDITION_MAX value + */ + protobuf.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNKNOWN"] = 0; + values[valuesById[998] = "EDITION_PROTO2"] = 998; + values[valuesById[999] = "EDITION_PROTO3"] = 999; + values[valuesById[1000] = "EDITION_2023"] = 1000; + values[valuesById[1001] = "EDITION_2024"] = 1001; + values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; + values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; + values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; + values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; + values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; + values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; + return values; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = 0; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 14: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.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["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.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.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + * @property {Array.|null} [declaration] ExtensionRangeOptions declaration + * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features + * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + this.declaration = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ExtensionRangeOptions declaration. + * @member {Array.} declaration + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.declaration = $util.emptyArray; + + /** + * ExtensionRangeOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.features = null; + + /** + * ExtensionRangeOptions verification. + * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.verification = 1; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.declaration != null && message.declaration.length) + for (var i = 0; i < message.declaration.length; ++i) + $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.declaration && message.declaration.length)) + message.declaration = []; + message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32())); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.verification = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message.declaration != null && message.hasOwnProperty("declaration")) { + if (!Array.isArray(message.declaration)) + return "declaration: array expected"; + for (var i = 0; i < message.declaration.length; ++i) { + var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i]); + if (error) + return "declaration." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.verification != null && message.hasOwnProperty("verification")) + switch (message.verification) { + default: + return "verification: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object.declaration) { + if (!Array.isArray(object.declaration)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); + message.declaration = []; + for (var i = 0; i < object.declaration.length; ++i) { + if (typeof object.declaration[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); + message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + switch (object.verification) { + case "DECLARATION": + case 0: + message.verification = 0; + break; + default: + if (typeof object.verification === "number") { + message.verification = object.verification; + break; + } + break; + case "UNVERIFIED": + case 1: + message.verification = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.declaration = []; + object.uninterpretedOption = []; + } + if (options.defaults) { + object.verification = options.enums === String ? "UNVERIFIED" : 1; + object.features = null; + } + if (message.declaration && message.declaration.length) { + object.declaration = []; + for (var j = 0; j < message.declaration.length; ++j) + object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); + } + if (message.verification != null && message.hasOwnProperty("verification")) + object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + ExtensionRangeOptions.Declaration = (function() { + + /** + * Properties of a Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @interface IDeclaration + * @property {number|null} [number] Declaration number + * @property {string|null} [fullName] Declaration fullName + * @property {string|null} [type] Declaration type + * @property {boolean|null} [reserved] Declaration reserved + * @property {boolean|null} [repeated] Declaration repeated + */ + + /** + * Constructs a new Declaration. + * @memberof google.protobuf.ExtensionRangeOptions + * @classdesc Represents a Declaration. + * @implements IDeclaration + * @constructor + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + */ + function Declaration(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]]; + } + + /** + * Declaration number. + * @member {number} number + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.number = 0; + + /** + * Declaration fullName. + * @member {string} fullName + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.fullName = ""; + + /** + * Declaration type. + * @member {string} type + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.type = ""; + + /** + * Declaration reserved. + * @member {boolean} reserved + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.reserved = false; + + /** + * Declaration repeated. + * @member {boolean} repeated + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + */ + Declaration.prototype.repeated = false; + + /** + * Creates a new Declaration instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance + */ + Declaration.create = function create(properties) { + return new Declaration(properties); + }; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); + if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); + return writer; + }; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Declaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.number = reader.int32(); + break; + } + case 2: { + message.fullName = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 5: { + message.reserved = reader.bool(); + break; + } + case 6: { + message.repeated = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Declaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Declaration message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Declaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.reserved != null && message.hasOwnProperty("reserved")) + if (typeof message.reserved !== "boolean") + return "reserved: boolean expected"; + if (message.repeated != null && message.hasOwnProperty("repeated")) + if (typeof message.repeated !== "boolean") + return "repeated: boolean expected"; + return null; + }; + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration + */ + Declaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); + if (object.number != null) + message.number = object.number | 0; + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.type != null) + message.type = String(object.type); + if (object.reserved != null) + message.reserved = Boolean(object.reserved); + if (object.repeated != null) + message.repeated = Boolean(object.repeated); + return message; + }; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Declaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.number = 0; + object.fullName = ""; + object.type = ""; + object.reserved = false; + object.repeated = false; + } + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.reserved != null && message.hasOwnProperty("reserved")) + object.reserved = message.reserved; + if (message.repeated != null && message.hasOwnProperty("repeated")) + object.repeated = message.repeated; + return object; + }; + + /** + * Converts this Declaration to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @instance + * @returns {Object.} JSON object + */ + Declaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Declaration + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions.Declaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; + }; + + return Declaration; + })(); + + /** + * VerificationState enum. + * @name google.protobuf.ExtensionRangeOptions.VerificationState + * @enum {number} + * @property {number} DECLARATION=0 DECLARATION value + * @property {number} UNVERIFIED=1 UNVERIFIED value + */ + ExtensionRangeOptions.VerificationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DECLARATION"] = 0; + values[valuesById[1] = "UNVERIFIED"] = 1; + return values; + })(); + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 3: + case 2: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.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.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.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.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.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.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.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.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.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.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.features = null; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 50: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FileOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object.features = null; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * MessageOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.features = null; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 11: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 12: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MessageOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {boolean|null} [debugRedact] FieldOptions debugRedact + * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention + * @property {Array.|null} [targets] FieldOptions targets + * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults + * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 16: { + message.debugRedact = reader.bool(); + break; + } + case 17: { + message.retention = reader.int32(); + break; + } + case 19: { + if (!(message.targets && message.targets.length)) + message.targets = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.targets.push(reader.int32()); + } else + message.targets.push(reader.int32()); + break; + } + case 20: { + if (!(message.editionDefaults && message.editionDefaults.length)) + message.editionDefaults = []; + message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32())); + break; + } + case 21: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(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]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EditionDefault message. + * @function verify + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + */ + EditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) + return object; + var message = new $root.google.protobuf.FieldOptions.EditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.value = ""; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this EditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + * @returns {Object.} JSON object + */ + EditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; + }; + + return EditionDefault; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.features = null; + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.OneofOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.features = null; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts + * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions deprecatedLegacyJsonFieldConflicts. + * @member {boolean} deprecatedLegacyJsonFieldConflicts + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; + + /** + * EnumOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.features = null; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 6: { + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + } + case 7: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") + return "deprecatedLegacyJsonFieldConflicts: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.deprecatedLegacyJsonFieldConflicts != null) + message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object.deprecatedLegacyJsonFieldConflicts = false; + object.features = null; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) + object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features + * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.features = null; + + /** + * EnumValueOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.debugRedact = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 3: { + message.debugRedact = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object.debugRedact = false; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.features = null; + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * ServiceOptions .google.api.apiVersion. + * @member {string} .google.api.apiVersion + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.apiVersion"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) + writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + case 525000001: { + message[".google.api.apiVersion"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + if (!$util.isString(message[".google.api.apiVersion"])) + return ".google.api.apiVersion: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + if (object[".google.api.apiVersion"] != null) + message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.features = null; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + object[".google.api.apiVersion"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) + object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.features = null; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 35: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.MethodOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object.features = null; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.FeatureSet = (function() { + + /** + * Properties of a FeatureSet. + * @memberof google.protobuf + * @interface IFeatureSet + * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence + * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType + * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding + * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation + * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding + * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat + */ + + /** + * Constructs a new FeatureSet. + * @memberof google.protobuf + * @classdesc Represents a FeatureSet. + * @implements IFeatureSet + * @constructor + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + */ + function FeatureSet(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]]; + } + + /** + * FeatureSet fieldPresence. + * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.fieldPresence = 0; + + /** + * FeatureSet enumType. + * @member {google.protobuf.FeatureSet.EnumType} enumType + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.enumType = 0; + + /** + * FeatureSet repeatedFieldEncoding. + * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.repeatedFieldEncoding = 0; + + /** + * FeatureSet utf8Validation. + * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.utf8Validation = 0; + + /** + * FeatureSet messageEncoding. + * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.messageEncoding = 0; + + /** + * FeatureSet jsonFormat. + * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat + * @memberof google.protobuf.FeatureSet + * @instance + */ + FeatureSet.prototype.jsonFormat = 0; + + /** + * Creates a new FeatureSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet=} [properties] Properties to set + * @returns {google.protobuf.FeatureSet} FeatureSet instance + */ + FeatureSet.create = function create(properties) { + return new FeatureSet(properties); + }; + + /** + * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); + if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); + if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); + if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); + if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); + if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); + return writer; + }; + + /** + * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fieldPresence = reader.int32(); + break; + } + case 2: { + message.enumType = reader.int32(); + break; + } + case 3: { + message.repeatedFieldEncoding = reader.int32(); + break; + } + case 4: { + message.utf8Validation = reader.int32(); + break; + } + case 5: { + message.messageEncoding = reader.int32(); + break; + } + case 6: { + message.jsonFormat = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSet} FeatureSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSet message. + * @function verify + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + switch (message.fieldPresence) { + default: + return "fieldPresence: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.enumType != null && message.hasOwnProperty("enumType")) + switch (message.enumType) { + default: + return "enumType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + switch (message.repeatedFieldEncoding) { + default: + return "repeatedFieldEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + switch (message.utf8Validation) { + default: + return "utf8Validation: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + switch (message.messageEncoding) { + default: + return "messageEncoding: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + switch (message.jsonFormat) { + default: + return "jsonFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSet} FeatureSet + */ + FeatureSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSet) + return object; + var message = new $root.google.protobuf.FeatureSet(); + switch (object.fieldPresence) { + default: + if (typeof object.fieldPresence === "number") { + message.fieldPresence = object.fieldPresence; + break; + } + break; + case "FIELD_PRESENCE_UNKNOWN": + case 0: + message.fieldPresence = 0; + break; + case "EXPLICIT": + case 1: + message.fieldPresence = 1; + break; + case "IMPLICIT": + case 2: + message.fieldPresence = 2; + break; + case "LEGACY_REQUIRED": + case 3: + message.fieldPresence = 3; + break; + } + switch (object.enumType) { + default: + if (typeof object.enumType === "number") { + message.enumType = object.enumType; + break; + } + break; + case "ENUM_TYPE_UNKNOWN": + case 0: + message.enumType = 0; + break; + case "OPEN": + case 1: + message.enumType = 1; + break; + case "CLOSED": + case 2: + message.enumType = 2; + break; + } + switch (object.repeatedFieldEncoding) { + default: + if (typeof object.repeatedFieldEncoding === "number") { + message.repeatedFieldEncoding = object.repeatedFieldEncoding; + break; + } + break; + case "REPEATED_FIELD_ENCODING_UNKNOWN": + case 0: + message.repeatedFieldEncoding = 0; + break; + case "PACKED": + case 1: + message.repeatedFieldEncoding = 1; + break; + case "EXPANDED": + case 2: + message.repeatedFieldEncoding = 2; + break; + } + switch (object.utf8Validation) { + default: + if (typeof object.utf8Validation === "number") { + message.utf8Validation = object.utf8Validation; + break; + } + break; + case "UTF8_VALIDATION_UNKNOWN": + case 0: + message.utf8Validation = 0; + break; + case "VERIFY": + case 2: + message.utf8Validation = 2; + break; + case "NONE": + case 3: + message.utf8Validation = 3; + break; + } + switch (object.messageEncoding) { + default: + if (typeof object.messageEncoding === "number") { + message.messageEncoding = object.messageEncoding; + break; + } + break; + case "MESSAGE_ENCODING_UNKNOWN": + case 0: + message.messageEncoding = 0; + break; + case "LENGTH_PREFIXED": + case 1: + message.messageEncoding = 1; + break; + case "DELIMITED": + case 2: + message.messageEncoding = 2; + break; + } + switch (object.jsonFormat) { + default: + if (typeof object.jsonFormat === "number") { + message.jsonFormat = object.jsonFormat; + break; + } + break; + case "JSON_FORMAT_UNKNOWN": + case 0: + message.jsonFormat = 0; + break; + case "ALLOW": + case 1: + message.jsonFormat = 1; + break; + case "LEGACY_BEST_EFFORT": + case 2: + message.jsonFormat = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSet + * @static + * @param {google.protobuf.FeatureSet} message FeatureSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; + object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; + object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; + object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; + object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; + object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; + } + if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) + object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; + if (message.enumType != null && message.hasOwnProperty("enumType")) + object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; + if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) + object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; + if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) + object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; + if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) + object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; + if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) + object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; + return object; + }; + + /** + * Converts this FeatureSet to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSet + * @instance + * @returns {Object.} JSON object + */ + FeatureSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSet + * @function getTypeUrl + * @memberof google.protobuf.FeatureSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSet"; + }; + + /** + * FieldPresence enum. + * @name google.protobuf.FeatureSet.FieldPresence + * @enum {number} + * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value + * @property {number} EXPLICIT=1 EXPLICIT value + * @property {number} IMPLICIT=2 IMPLICIT value + * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value + */ + FeatureSet.FieldPresence = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; + values[valuesById[1] = "EXPLICIT"] = 1; + values[valuesById[2] = "IMPLICIT"] = 2; + values[valuesById[3] = "LEGACY_REQUIRED"] = 3; + return values; + })(); + + /** + * EnumType enum. + * @name google.protobuf.FeatureSet.EnumType + * @enum {number} + * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value + * @property {number} OPEN=1 OPEN value + * @property {number} CLOSED=2 CLOSED value + */ + FeatureSet.EnumType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "OPEN"] = 1; + values[valuesById[2] = "CLOSED"] = 2; + return values; + })(); + + /** + * RepeatedFieldEncoding enum. + * @name google.protobuf.FeatureSet.RepeatedFieldEncoding + * @enum {number} + * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value + * @property {number} PACKED=1 PACKED value + * @property {number} EXPANDED=2 EXPANDED value + */ + FeatureSet.RepeatedFieldEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "PACKED"] = 1; + values[valuesById[2] = "EXPANDED"] = 2; + return values; + })(); + + /** + * Utf8Validation enum. + * @name google.protobuf.FeatureSet.Utf8Validation + * @enum {number} + * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value + * @property {number} VERIFY=2 VERIFY value + * @property {number} NONE=3 NONE value + */ + FeatureSet.Utf8Validation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; + values[valuesById[2] = "VERIFY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + /** + * MessageEncoding enum. + * @name google.protobuf.FeatureSet.MessageEncoding + * @enum {number} + * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value + * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value + * @property {number} DELIMITED=2 DELIMITED value + */ + FeatureSet.MessageEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; + values[valuesById[1] = "LENGTH_PREFIXED"] = 1; + values[valuesById[2] = "DELIMITED"] = 2; + return values; + })(); + + /** + * JsonFormat enum. + * @name google.protobuf.FeatureSet.JsonFormat + * @enum {number} + * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value + * @property {number} ALLOW=1 ALLOW value + * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value + */ + FeatureSet.JsonFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; + values[valuesById[1] = "ALLOW"] = 1; + values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; + return values; + })(); + + return FeatureSet; + })(); + + protobuf.FeatureSetDefaults = (function() { + + /** + * Properties of a FeatureSetDefaults. + * @memberof google.protobuf + * @interface IFeatureSetDefaults + * @property {Array.|null} [defaults] FeatureSetDefaults defaults + * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition + * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition + */ + + /** + * Constructs a new FeatureSetDefaults. + * @memberof google.protobuf + * @classdesc Represents a FeatureSetDefaults. + * @implements IFeatureSetDefaults + * @constructor + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + */ + function FeatureSetDefaults(properties) { + this.defaults = []; + 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]]; + } + + /** + * FeatureSetDefaults defaults. + * @member {Array.} defaults + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.defaults = $util.emptyArray; + + /** + * FeatureSetDefaults minimumEdition. + * @member {google.protobuf.Edition} minimumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.minimumEdition = 0; + + /** + * FeatureSetDefaults maximumEdition. + * @member {google.protobuf.Edition} maximumEdition + * @memberof google.protobuf.FeatureSetDefaults + * @instance + */ + FeatureSetDefaults.prototype.maximumEdition = 0; + + /** + * Creates a new FeatureSetDefaults instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance + */ + FeatureSetDefaults.create = function create(properties) { + return new FeatureSetDefaults(properties); + }; + + /** + * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.defaults != null && message.defaults.length) + for (var i = 0; i < message.defaults.length; ++i) + $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); + if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); + return writer; + }; + + /** + * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.defaults && message.defaults.length)) + message.defaults = []; + message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32())); + break; + } + case 4: { + message.minimumEdition = reader.int32(); + break; + } + case 5: { + message.maximumEdition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetDefaults message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetDefaults.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.defaults != null && message.hasOwnProperty("defaults")) { + if (!Array.isArray(message.defaults)) + return "defaults: array expected"; + for (var i = 0; i < message.defaults.length; ++i) { + var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i]); + if (error) + return "defaults." + error; + } + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + switch (message.minimumEdition) { + default: + return "minimumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + switch (message.maximumEdition) { + default: + return "maximumEdition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + return null; + }; + + /** + * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults + */ + FeatureSetDefaults.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults(); + if (object.defaults) { + if (!Array.isArray(object.defaults)) + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); + message.defaults = []; + for (var i = 0; i < object.defaults.length; ++i) { + if (typeof object.defaults[i] !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); + message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i]); + } + } + switch (object.minimumEdition) { + default: + if (typeof object.minimumEdition === "number") { + message.minimumEdition = object.minimumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.minimumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.minimumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.minimumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.minimumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.minimumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.minimumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.minimumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.minimumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.minimumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.minimumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.minimumEdition = 2147483647; + break; + } + switch (object.maximumEdition) { + default: + if (typeof object.maximumEdition === "number") { + message.maximumEdition = object.maximumEdition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.maximumEdition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.maximumEdition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.maximumEdition = 999; + break; + case "EDITION_2023": + case 1000: + message.maximumEdition = 1000; + break; + case "EDITION_2024": + case 1001: + message.maximumEdition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.maximumEdition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.maximumEdition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.maximumEdition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.maximumEdition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.maximumEdition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.maximumEdition = 2147483647; + break; + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetDefaults.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.defaults = []; + if (options.defaults) { + object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.defaults && message.defaults.length) { + object.defaults = []; + for (var j = 0; j < message.defaults.length; ++j) + object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); + } + if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) + object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; + if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) + object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; + return object; + }; + + /** + * Converts this FeatureSetDefaults to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults + * @instance + * @returns {Object.} JSON object + */ + FeatureSetDefaults.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetDefaults + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; + }; + + FeatureSetDefaults.FeatureSetEditionDefault = (function() { + + /** + * Properties of a FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @interface IFeatureSetEditionDefault + * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition + * @property {google.protobuf.IFeatureSet|null} [features] FeatureSetEditionDefault features + */ + + /** + * Constructs a new FeatureSetEditionDefault. + * @memberof google.protobuf.FeatureSetDefaults + * @classdesc Represents a FeatureSetEditionDefault. + * @implements IFeatureSetEditionDefault + * @constructor + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + */ + function FeatureSetEditionDefault(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]]; + } + + /** + * FeatureSetEditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.edition = 0; + + /** + * FeatureSetEditionDefault features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + */ + FeatureSetEditionDefault.prototype.features = null; + + /** + * Creates a new FeatureSetEditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance + */ + FeatureSetEditionDefault.create = function create(properties) { + return new FeatureSetEditionDefault(properties); + }; + + /** + * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.edition = reader.int32(); + break; + } + case 2: { + message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSetEditionDefault message. + * @function verify + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSetEditionDefault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + switch (message.edition) { + default: + return "edition: enum value expected"; + case 0: + case 998: + case 999: + case 1000: + case 1001: + case 1: + case 2: + case 99997: + case 99998: + case 99999: + case 2147483647: + break; + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + return null; + }; + + /** + * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault + */ + FeatureSetEditionDefault.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) + return object; + var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNKNOWN": + case 0: + message.edition = 0; + break; + case "EDITION_PROTO2": + case 998: + message.edition = 998; + break; + case "EDITION_PROTO3": + case 999: + message.edition = 999; + break; + case "EDITION_2023": + case 1000: + message.edition = 1000; + break; + case "EDITION_2024": + case 1001: + message.edition = 1001; + break; + case "EDITION_1_TEST_ONLY": + case 1: + message.edition = 1; + break; + case "EDITION_2_TEST_ONLY": + case 2: + message.edition = 2; + break; + case "EDITION_99997_TEST_ONLY": + case 99997: + message.edition = 99997; + break; + case "EDITION_99998_TEST_ONLY": + case 99998: + message.edition = 99998; + break; + case "EDITION_99999_TEST_ONLY": + case 99999: + message.edition = 99999; + break; + case "EDITION_MAX": + case 2147483647: + message.edition = 2147483647; + break; + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + return message; + }; + + /** + * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSetEditionDefault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.features = null; + object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this FeatureSetEditionDefault to JSON. + * @function toJSON + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @instance + * @returns {Object.} JSON object + */ + FeatureSetEditionDefault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSetEditionDefault + * @function getTypeUrl + * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; + }; + + return FeatureSetEditionDefault; + })(); + + return FeatureSetDefaults; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.Duration = (function() { + + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ + + /** + * Constructs a new Duration. + * @memberof google.protobuf + * @classdesc Represents a Duration. + * @implements IDuration + * @constructor + * @param {google.protobuf.IDuration=} [properties] Properties to set + */ + function Duration(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]]; + } + + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; + + /** + * Creates a new Duration instance using the specified properties. + * @function create + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance + */ + Duration.create = function create(properties) { + return new Duration(properties); + }; + + /** + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(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]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. + * @function toJSON + * @memberof google.protobuf.Timestamp + * @instance + * @returns {Object.} JSON object + */ + Timestamp.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Timestamp + * @function getTypeUrl + * @memberof google.protobuf.Timestamp + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Timestamp"; + }; + + return Timestamp; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + 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]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Struct + * @function getTypeUrl + * @memberof google.protobuf.Struct + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Struct"; + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(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]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; + + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nullValue = reader.int32(); + break; + } + case 2: { + message.numberValue = reader.double(); + break; + } + case 3: { + message.stringValue = reader.string(); + break; + } + case 4: { + message.boolValue = reader.bool(); + break; + } + case 5: { + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 6: { + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Value + * @function getTypeUrl + * @memberof google.protobuf.Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Value"; + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + 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]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListValue + * @function getTypeUrl + * @memberof google.protobuf.ListValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ListValue"; + }; + + return ListValue; + })(); + + return protobuf; + })(); + + google.longrunning = (function() { + + /** + * Namespace longrunning. + * @memberof google + * @namespace + */ + var longrunning = {}; + + longrunning.Operations = (function() { + + /** + * Constructs a new Operations service. + * @memberof google.longrunning + * @classdesc Represents an Operations + * @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 Operations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; + + /** + * Creates new Operations service using the specified rpc implementation. + * @function create + * @memberof google.longrunning.Operations + * @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 {Operations} RPC service. Useful where requests and/or responses are streamed. + */ + Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.longrunning.Operations|listOperations}. + * @memberof google.longrunning.Operations + * @typedef ListOperationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse + */ + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { + return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); + }, "name", { value: "ListOperations" }); + + /** + * Calls ListOperations. + * @function listOperations + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|getOperation}. + * @memberof google.longrunning.Operations + * @typedef GetOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { + return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "GetOperation" }); + + /** + * Calls GetOperation. + * @function getOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. + * @memberof google.longrunning.Operations + * @typedef DeleteOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { + return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteOperation" }); + + /** + * Calls DeleteOperation. + * @function deleteOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. + * @memberof google.longrunning.Operations + * @typedef CancelOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { + return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "CancelOperation" }); + + /** + * Calls CancelOperation. + * @function cancelOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.longrunning.Operations|waitOperation}. + * @memberof google.longrunning.Operations + * @typedef WaitOperationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { + return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "WaitOperation" }); + + /** + * Calls WaitOperation. + * @function waitOperation + * @memberof google.longrunning.Operations + * @instance + * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Operations; + })(); + + longrunning.Operation = (function() { + + /** + * Properties of an Operation. + * @memberof google.longrunning + * @interface IOperation + * @property {string|null} [name] Operation name + * @property {google.protobuf.IAny|null} [metadata] Operation metadata + * @property {boolean|null} [done] Operation done + * @property {google.rpc.IStatus|null} [error] Operation error + * @property {google.protobuf.IAny|null} [response] Operation response + */ + + /** + * Constructs a new Operation. + * @memberof google.longrunning + * @classdesc Represents an Operation. + * @implements IOperation + * @constructor + * @param {google.longrunning.IOperation=} [properties] Properties to set + */ + function Operation(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]]; + } + + /** + * Operation name. + * @member {string} name + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.name = ""; + + /** + * Operation metadata. + * @member {google.protobuf.IAny|null|undefined} metadata + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.metadata = null; + + /** + * Operation done. + * @member {boolean} done + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.done = false; + + /** + * Operation error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.error = null; + + /** + * Operation response. + * @member {google.protobuf.IAny|null|undefined} response + * @memberof google.longrunning.Operation + * @instance + */ + Operation.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Operation result. + * @member {"error"|"response"|undefined} result + * @memberof google.longrunning.Operation + * @instance + */ + Object.defineProperty(Operation.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["error", "response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Operation instance using the specified properties. + * @function create + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation=} [properties] Properties to set + * @returns {google.longrunning.Operation} Operation instance + */ + Operation.create = function create(properties) { + return new Operation(properties); + }; + + /** + * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encode + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.IOperation} message Operation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Operation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Operation message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.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.longrunning.Operation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + case 3: { + message.done = reader.bool(); + break; + } + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.response = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Operation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.Operation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.Operation} Operation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Operation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Operation message. + * @function verify + * @memberof google.longrunning.Operation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Operation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Any.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.error != null && message.hasOwnProperty("error")) { + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.protobuf.Any.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates an Operation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.Operation + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.Operation} Operation + */ + Operation.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.Operation) + return object; + var message = new $root.google.longrunning.Operation(); + if (object.name != null) + message.name = String(object.name); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.longrunning.Operation.metadata: object expected"); + message.metadata = $root.google.protobuf.Any.fromObject(object.metadata); + } + if (object.done != null) + message.done = Boolean(object.done); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.longrunning.Operation.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.longrunning.Operation.response: object expected"); + message.response = $root.google.protobuf.Any.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from an Operation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.Operation + * @static + * @param {google.longrunning.Operation} message Operation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Operation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.metadata = null; + object.done = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.protobuf.Any.toObject(message.response, options); + if (options.oneofs) + object.result = "response"; + } + return object; + }; + + /** + * Converts this Operation to JSON. + * @function toJSON + * @memberof google.longrunning.Operation + * @instance + * @returns {Object.} JSON object + */ + Operation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Operation + * @function getTypeUrl + * @memberof google.longrunning.Operation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.Operation"; + }; + + return Operation; + })(); + + longrunning.GetOperationRequest = (function() { + + /** + * Properties of a GetOperationRequest. + * @memberof google.longrunning + * @interface IGetOperationRequest + * @property {string|null} [name] GetOperationRequest name + */ + + /** + * Constructs a new GetOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a GetOperationRequest. + * @implements IGetOperationRequest + * @constructor + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + */ + function GetOperationRequest(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]]; + } + + /** + * GetOperationRequest name. + * @member {string} name + * @memberof google.longrunning.GetOperationRequest + * @instance + */ + GetOperationRequest.prototype.name = ""; + + /** + * Creates a new GetOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance + */ + GetOperationRequest.create = function create(properties) { + return new GetOperationRequest(properties); + }; + + /** + * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.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.longrunning.GetOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetOperationRequest message. + * @function verify + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.GetOperationRequest} GetOperationRequest + */ + GetOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.GetOperationRequest) + return object; + var message = new $root.google.longrunning.GetOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {google.longrunning.GetOperationRequest} message GetOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.GetOperationRequest + * @instance + * @returns {Object.} JSON object + */ + GetOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.GetOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; + }; + + return GetOperationRequest; + })(); + + longrunning.ListOperationsRequest = (function() { + + /** + * Properties of a ListOperationsRequest. + * @memberof google.longrunning + * @interface IListOperationsRequest + * @property {string|null} [name] ListOperationsRequest name + * @property {string|null} [filter] ListOperationsRequest filter + * @property {number|null} [pageSize] ListOperationsRequest pageSize + * @property {string|null} [pageToken] ListOperationsRequest pageToken + */ + + /** + * Constructs a new ListOperationsRequest. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsRequest. + * @implements IListOperationsRequest + * @constructor + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + */ + function ListOperationsRequest(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]]; + } + + /** + * ListOperationsRequest name. + * @member {string} name + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.name = ""; + + /** + * ListOperationsRequest filter. + * @member {string} filter + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.filter = ""; + + /** + * ListOperationsRequest pageSize. + * @member {number} pageSize + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageSize = 0; + + /** + * ListOperationsRequest pageToken. + * @member {string} pageToken + * @memberof google.longrunning.ListOperationsRequest + * @instance + */ + ListOperationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListOperationsRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance + */ + ListOperationsRequest.create = function create(properties) { + return new ListOperationsRequest(properties); + }; + + /** + * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.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.longrunning.ListOperationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.name = reader.string(); + break; + } + case 1: { + message.filter = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsRequest message. + * @function verify + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsRequest.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.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest + */ + ListOperationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsRequest) + return object; + var message = new $root.google.longrunning.ListOperationsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.name = ""; + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this ListOperationsRequest to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListOperationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsRequest + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; + }; + + return ListOperationsRequest; + })(); + + longrunning.ListOperationsResponse = (function() { + + /** + * Properties of a ListOperationsResponse. + * @memberof google.longrunning + * @interface IListOperationsResponse + * @property {Array.|null} [operations] ListOperationsResponse operations + * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken + */ + + /** + * Constructs a new ListOperationsResponse. + * @memberof google.longrunning + * @classdesc Represents a ListOperationsResponse. + * @implements IListOperationsResponse + * @constructor + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + */ + function ListOperationsResponse(properties) { + this.operations = []; + 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]]; + } + + /** + * ListOperationsResponse operations. + * @member {Array.} operations + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.operations = $util.emptyArray; + + /** + * ListOperationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.longrunning.ListOperationsResponse + * @instance + */ + ListOperationsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListOperationsResponse instance using the specified properties. + * @function create + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance + */ + ListOperationsResponse.create = function create(properties) { + return new ListOperationsResponse(properties); + }; + + /** + * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.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.longrunning.ListOperationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListOperationsResponse message. + * @function verify + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListOperationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.longrunning.Operation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse + */ + ListOperationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.ListOperationsResponse) + return object; + var message = new $root.google.longrunning.ListOperationsResponse(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); + message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListOperationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.operations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListOperationsResponse to JSON. + * @function toJSON + * @memberof google.longrunning.ListOperationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListOperationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListOperationsResponse + * @function getTypeUrl + * @memberof google.longrunning.ListOperationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; + }; + + return ListOperationsResponse; + })(); + + longrunning.CancelOperationRequest = (function() { + + /** + * Properties of a CancelOperationRequest. + * @memberof google.longrunning + * @interface ICancelOperationRequest + * @property {string|null} [name] CancelOperationRequest name + */ + + /** + * Constructs a new CancelOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a CancelOperationRequest. + * @implements ICancelOperationRequest + * @constructor + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + */ + function CancelOperationRequest(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]]; + } + + /** + * CancelOperationRequest name. + * @member {string} name + * @memberof google.longrunning.CancelOperationRequest + * @instance + */ + CancelOperationRequest.prototype.name = ""; + + /** + * Creates a new CancelOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance + */ + CancelOperationRequest.create = function create(properties) { + return new CancelOperationRequest(properties); + }; + + /** + * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.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.longrunning.CancelOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelOperationRequest message. + * @function verify + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest + */ + CancelOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.CancelOperationRequest) + return object; + var message = new $root.google.longrunning.CancelOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this CancelOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.CancelOperationRequest + * @instance + * @returns {Object.} JSON object + */ + CancelOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.CancelOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; + }; + + return CancelOperationRequest; + })(); + + longrunning.DeleteOperationRequest = (function() { + + /** + * Properties of a DeleteOperationRequest. + * @memberof google.longrunning + * @interface IDeleteOperationRequest + * @property {string|null} [name] DeleteOperationRequest name + */ + + /** + * Constructs a new DeleteOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a DeleteOperationRequest. + * @implements IDeleteOperationRequest + * @constructor + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + */ + function DeleteOperationRequest(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]]; + } + + /** + * DeleteOperationRequest name. + * @member {string} name + * @memberof google.longrunning.DeleteOperationRequest + * @instance + */ + DeleteOperationRequest.prototype.name = ""; + + /** + * Creates a new DeleteOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance + */ + DeleteOperationRequest.create = function create(properties) { + return new DeleteOperationRequest(properties); + }; + + /** + * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.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.longrunning.DeleteOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteOperationRequest message. + * @function verify + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteOperationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest + */ + DeleteOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.DeleteOperationRequest) + return object; + var message = new $root.google.longrunning.DeleteOperationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.DeleteOperationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.DeleteOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; + }; + + return DeleteOperationRequest; + })(); + + longrunning.WaitOperationRequest = (function() { + + /** + * Properties of a WaitOperationRequest. + * @memberof google.longrunning + * @interface IWaitOperationRequest + * @property {string|null} [name] WaitOperationRequest name + * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout + */ + + /** + * Constructs a new WaitOperationRequest. + * @memberof google.longrunning + * @classdesc Represents a WaitOperationRequest. + * @implements IWaitOperationRequest + * @constructor + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + */ + function WaitOperationRequest(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]]; + } + + /** + * WaitOperationRequest name. + * @member {string} name + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.name = ""; + + /** + * WaitOperationRequest timeout. + * @member {google.protobuf.IDuration|null|undefined} timeout + * @memberof google.longrunning.WaitOperationRequest + * @instance + */ + WaitOperationRequest.prototype.timeout = null; + + /** + * Creates a new WaitOperationRequest instance using the specified properties. + * @function create + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance + */ + WaitOperationRequest.create = function create(properties) { + return new WaitOperationRequest(properties); + }; + + /** + * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) + $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.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.longrunning.WaitOperationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitOperationRequest message. + * @function verify + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitOperationRequest.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.timeout != null && message.hasOwnProperty("timeout")) { + var error = $root.google.protobuf.Duration.verify(message.timeout); + if (error) + return "timeout." + error; + } + return null; + }; + + /** + * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest + */ + WaitOperationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.WaitOperationRequest) + return object; + var message = new $root.google.longrunning.WaitOperationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.timeout != null) { + if (typeof object.timeout !== "object") + throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); + message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout); + } + return message; + }; + + /** + * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitOperationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.timeout = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.timeout != null && message.hasOwnProperty("timeout")) + object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); + return object; + }; + + /** + * Converts this WaitOperationRequest to JSON. + * @function toJSON + * @memberof google.longrunning.WaitOperationRequest + * @instance + * @returns {Object.} JSON object + */ + WaitOperationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WaitOperationRequest + * @function getTypeUrl + * @memberof google.longrunning.WaitOperationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; + }; + + return WaitOperationRequest; + })(); + + longrunning.OperationInfo = (function() { + + /** + * Properties of an OperationInfo. + * @memberof google.longrunning + * @interface IOperationInfo + * @property {string|null} [responseType] OperationInfo responseType + * @property {string|null} [metadataType] OperationInfo metadataType + */ + + /** + * Constructs a new OperationInfo. + * @memberof google.longrunning + * @classdesc Represents an OperationInfo. + * @implements IOperationInfo + * @constructor + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + */ + function OperationInfo(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]]; + } + + /** + * OperationInfo responseType. + * @member {string} responseType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.responseType = ""; + + /** + * OperationInfo metadataType. + * @member {string} metadataType + * @memberof google.longrunning.OperationInfo + * @instance + */ + OperationInfo.prototype.metadataType = ""; + + /** + * Creates a new OperationInfo instance using the specified properties. + * @function create + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo=} [properties] Properties to set + * @returns {google.longrunning.OperationInfo} OperationInfo instance + */ + OperationInfo.create = function create(properties) { + return new OperationInfo(properties); + }; + + /** + * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encode + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); + return writer; + }; + + /** + * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer. + * @function decode + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.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.longrunning.OperationInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.longrunning.OperationInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.longrunning.OperationInfo} OperationInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationInfo message. + * @function verify + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseType != null && message.hasOwnProperty("responseType")) + if (!$util.isString(message.responseType)) + return "responseType: string expected"; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (!$util.isString(message.metadataType)) + return "metadataType: string expected"; + return null; + }; + + /** + * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {Object.} object Plain object + * @returns {google.longrunning.OperationInfo} OperationInfo + */ + OperationInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.longrunning.OperationInfo) + return object; + var message = new $root.google.longrunning.OperationInfo(); + if (object.responseType != null) + message.responseType = String(object.responseType); + if (object.metadataType != null) + message.metadataType = String(object.metadataType); + return message; + }; + + /** + * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.longrunning.OperationInfo + * @static + * @param {google.longrunning.OperationInfo} message OperationInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseType = ""; + object.metadataType = ""; + } + if (message.responseType != null && message.hasOwnProperty("responseType")) + object.responseType = message.responseType; + if (message.metadataType != null && message.hasOwnProperty("metadataType")) + object.metadataType = message.metadataType; + return object; + }; + + /** + * Converts this OperationInfo to JSON. + * @function toJSON + * @memberof google.longrunning.OperationInfo + * @instance + * @returns {Object.} JSON object + */ + OperationInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationInfo + * @function getTypeUrl + * @memberof google.longrunning.OperationInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.longrunning.OperationInfo"; + }; + + return OperationInfo; + })(); + + return longrunning; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + 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]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.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.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + this.auditConfigs = []; + 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]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.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.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length >= 0) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindings = []; + object.auditConfigs = []; + } + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + 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]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.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.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + + return Binding; + })(); + + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + 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]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.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.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + 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]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.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.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + 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]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.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.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(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]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.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.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(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]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.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.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + + return Expr; + })(); + + return type; + })(); + + google.identity = (function() { + + /** + * Namespace identity. + * @memberof google + * @namespace + */ + var identity = {}; + + identity.accesscontextmanager = (function() { + + /** + * Namespace accesscontextmanager. + * @memberof google.identity + * @namespace + */ + var accesscontextmanager = {}; + + accesscontextmanager.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var v1 = {}; + + v1.AccessLevel = (function() { + + /** + * Properties of an AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessLevel + * @property {string|null} [name] AccessLevel name + * @property {string|null} [title] AccessLevel title + * @property {string|null} [description] AccessLevel description + * @property {google.identity.accesscontextmanager.v1.IBasicLevel|null} [basic] AccessLevel basic + * @property {google.identity.accesscontextmanager.v1.ICustomLevel|null} [custom] AccessLevel custom + * @property {google.protobuf.ITimestamp|null} [createTime] AccessLevel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessLevel updateTime + */ + + /** + * Constructs a new AccessLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessLevel. + * @implements IAccessLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + */ + function AccessLevel(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]]; + } + + /** + * AccessLevel name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.name = ""; + + /** + * AccessLevel title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.title = ""; + + /** + * AccessLevel description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.description = ""; + + /** + * AccessLevel basic. + * @member {google.identity.accesscontextmanager.v1.IBasicLevel|null|undefined} basic + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.basic = null; + + /** + * AccessLevel custom. + * @member {google.identity.accesscontextmanager.v1.ICustomLevel|null|undefined} custom + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.custom = null; + + /** + * AccessLevel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.createTime = null; + + /** + * AccessLevel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + AccessLevel.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessLevel level. + * @member {"basic"|"custom"|undefined} level + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + */ + Object.defineProperty(AccessLevel.prototype, "level", { + get: $util.oneOfGetter($oneOfFields = ["basic", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel instance + */ + AccessLevel.create = function create(properties) { + return new AccessLevel(properties); + }; + + /** + * Encodes the specified AccessLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.basic != null && Object.hasOwnProperty.call(message, "basic")) + $root.google.identity.accesscontextmanager.v1.BasicLevel.encode(message.basic, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.identity.accesscontextmanager.v1.CustomLevel.encode(message.custom, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AccessLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessLevel} message AccessLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.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.identity.accesscontextmanager.v1.AccessLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.decode(reader, reader.uint32()); + break; + } + case 5: { + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.decode(reader, reader.uint32()); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.basic != null && message.hasOwnProperty("basic")) { + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.BasicLevel.verify(message.basic); + if (error) + return "basic." + error; + } + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.level === 1) + return "level: multiple values"; + properties.level = 1; + { + var error = $root.google.identity.accesscontextmanager.v1.CustomLevel.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an AccessLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessLevel} AccessLevel + */ + AccessLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessLevel(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.basic != null) { + if (typeof object.basic !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.basic: object expected"); + message.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.fromObject(object.basic); + } + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.custom: object expected"); + message.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.fromObject(object.custom); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessLevel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an AccessLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {google.identity.accesscontextmanager.v1.AccessLevel} message AccessLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.basic != null && message.hasOwnProperty("basic")) { + object.basic = $root.google.identity.accesscontextmanager.v1.BasicLevel.toObject(message.basic, options); + if (options.oneofs) + object.level = "basic"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.identity.accesscontextmanager.v1.CustomLevel.toObject(message.custom, options); + if (options.oneofs) + object.level = "custom"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this AccessLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @instance + * @returns {Object.} JSON object + */ + AccessLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessLevel"; + }; + + return AccessLevel; + })(); + + v1.BasicLevel = (function() { + + /** + * Properties of a BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IBasicLevel + * @property {Array.|null} [conditions] BasicLevel conditions + * @property {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction|null} [combiningFunction] BasicLevel combiningFunction + */ + + /** + * Constructs a new BasicLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a BasicLevel. + * @implements IBasicLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + */ + function BasicLevel(properties) { + this.conditions = []; + 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]]; + } + + /** + * BasicLevel conditions. + * @member {Array.} conditions + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.conditions = $util.emptyArray; + + /** + * BasicLevel combiningFunction. + * @member {google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction} combiningFunction + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + */ + BasicLevel.prototype.combiningFunction = 0; + + /** + * Creates a new BasicLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel instance + */ + BasicLevel.create = function create(properties) { + return new BasicLevel(properties); + }; + + /** + * Encodes the specified BasicLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.identity.accesscontextmanager.v1.Condition.encode(message.conditions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.combiningFunction != null && Object.hasOwnProperty.call(message, "combiningFunction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.combiningFunction); + return writer; + }; + + /** + * Encodes the specified BasicLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.BasicLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.IBasicLevel} message BasicLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.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.identity.accesscontextmanager.v1.BasicLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.identity.accesscontextmanager.v1.Condition.decode(reader, reader.uint32())); + break; + } + case 2: { + message.combiningFunction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + switch (message.combiningFunction) { + default: + return "combiningFunction: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a BasicLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.BasicLevel} BasicLevel + */ + BasicLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.BasicLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.BasicLevel(); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.BasicLevel.conditions: object expected"); + message.conditions[i] = $root.google.identity.accesscontextmanager.v1.Condition.fromObject(object.conditions[i]); + } + } + switch (object.combiningFunction) { + default: + if (typeof object.combiningFunction === "number") { + message.combiningFunction = object.combiningFunction; + break; + } + break; + case "AND": + case 0: + message.combiningFunction = 0; + break; + case "OR": + case 1: + message.combiningFunction = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a BasicLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {google.identity.accesscontextmanager.v1.BasicLevel} message BasicLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (options.defaults) + object.combiningFunction = options.enums === String ? "AND" : 0; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.identity.accesscontextmanager.v1.Condition.toObject(message.conditions[j], options); + } + if (message.combiningFunction != null && message.hasOwnProperty("combiningFunction")) + object.combiningFunction = options.enums === String ? $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] === undefined ? message.combiningFunction : $root.google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction[message.combiningFunction] : message.combiningFunction; + return object; + }; + + /** + * Converts this BasicLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @instance + * @returns {Object.} JSON object + */ + BasicLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BasicLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.BasicLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BasicLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.BasicLevel"; + }; + + /** + * ConditionCombiningFunction enum. + * @name google.identity.accesscontextmanager.v1.BasicLevel.ConditionCombiningFunction + * @enum {number} + * @property {number} AND=0 AND value + * @property {number} OR=1 OR value + */ + BasicLevel.ConditionCombiningFunction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AND"] = 0; + values[valuesById[1] = "OR"] = 1; + return values; + })(); + + return BasicLevel; + })(); + + v1.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICondition + * @property {Array.|null} [ipSubnetworks] Condition ipSubnetworks + * @property {google.identity.accesscontextmanager.v1.IDevicePolicy|null} [devicePolicy] Condition devicePolicy + * @property {Array.|null} [requiredAccessLevels] Condition requiredAccessLevels + * @property {boolean|null} [negate] Condition negate + * @property {Array.|null} [members] Condition members + * @property {Array.|null} [regions] Condition regions + */ + + /** + * Constructs a new Condition. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + this.ipSubnetworks = []; + this.requiredAccessLevels = []; + this.members = []; + this.regions = []; + 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]]; + } + + /** + * Condition ipSubnetworks. + * @member {Array.} ipSubnetworks + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.ipSubnetworks = $util.emptyArray; + + /** + * Condition devicePolicy. + * @member {google.identity.accesscontextmanager.v1.IDevicePolicy|null|undefined} devicePolicy + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.devicePolicy = null; + + /** + * Condition requiredAccessLevels. + * @member {Array.} requiredAccessLevels + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.requiredAccessLevels = $util.emptyArray; + + /** + * Condition negate. + * @member {boolean} negate + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.negate = false; + + /** + * Condition members. + * @member {Array.} members + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.members = $util.emptyArray; + + /** + * Condition regions. + * @member {Array.} regions + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + */ + Condition.prototype.regions = $util.emptyArray; + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipSubnetworks != null && message.ipSubnetworks.length) + for (var i = 0; i < message.ipSubnetworks.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipSubnetworks[i]); + if (message.devicePolicy != null && Object.hasOwnProperty.call(message, "devicePolicy")) + $root.google.identity.accesscontextmanager.v1.DevicePolicy.encode(message.devicePolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requiredAccessLevels != null && message.requiredAccessLevels.length) + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requiredAccessLevels[i]); + if (message.negate != null && Object.hasOwnProperty.call(message, "negate")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.negate); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.members[i]); + if (message.regions != null && message.regions.length) + for (var i = 0; i < message.regions.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.regions[i]); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.ICondition} message Condition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Condition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.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.identity.accesscontextmanager.v1.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ipSubnetworks && message.ipSubnetworks.length)) + message.ipSubnetworks = []; + message.ipSubnetworks.push(reader.string()); + break; + } + case 2: { + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.requiredAccessLevels && message.requiredAccessLevels.length)) + message.requiredAccessLevels = []; + message.requiredAccessLevels.push(reader.string()); + break; + } + case 5: { + message.negate = reader.bool(); + break; + } + case 6: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 7: { + if (!(message.regions && message.regions.length)) + message.regions = []; + message.regions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Condition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Condition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipSubnetworks != null && message.hasOwnProperty("ipSubnetworks")) { + if (!Array.isArray(message.ipSubnetworks)) + return "ipSubnetworks: array expected"; + for (var i = 0; i < message.ipSubnetworks.length; ++i) + if (!$util.isString(message.ipSubnetworks[i])) + return "ipSubnetworks: string[] expected"; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) { + var error = $root.google.identity.accesscontextmanager.v1.DevicePolicy.verify(message.devicePolicy); + if (error) + return "devicePolicy." + error; + } + if (message.requiredAccessLevels != null && message.hasOwnProperty("requiredAccessLevels")) { + if (!Array.isArray(message.requiredAccessLevels)) + return "requiredAccessLevels: array expected"; + for (var i = 0; i < message.requiredAccessLevels.length; ++i) + if (!$util.isString(message.requiredAccessLevels[i])) + return "requiredAccessLevels: string[] expected"; + } + if (message.negate != null && message.hasOwnProperty("negate")) + if (typeof message.negate !== "boolean") + return "negate: boolean expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.regions != null && message.hasOwnProperty("regions")) { + if (!Array.isArray(message.regions)) + return "regions: array expected"; + for (var i = 0; i < message.regions.length; ++i) + if (!$util.isString(message.regions[i])) + return "regions: string[] expected"; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.Condition) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.Condition(); + if (object.ipSubnetworks) { + if (!Array.isArray(object.ipSubnetworks)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.ipSubnetworks: array expected"); + message.ipSubnetworks = []; + for (var i = 0; i < object.ipSubnetworks.length; ++i) + message.ipSubnetworks[i] = String(object.ipSubnetworks[i]); + } + if (object.devicePolicy != null) { + if (typeof object.devicePolicy !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.devicePolicy: object expected"); + message.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.fromObject(object.devicePolicy); + } + if (object.requiredAccessLevels) { + if (!Array.isArray(object.requiredAccessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.requiredAccessLevels: array expected"); + message.requiredAccessLevels = []; + for (var i = 0; i < object.requiredAccessLevels.length; ++i) + message.requiredAccessLevels[i] = String(object.requiredAccessLevels[i]); + } + if (object.negate != null) + message.negate = Boolean(object.negate); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.regions) { + if (!Array.isArray(object.regions)) + throw TypeError(".google.identity.accesscontextmanager.v1.Condition.regions: array expected"); + message.regions = []; + for (var i = 0; i < object.regions.length; ++i) + message.regions[i] = String(object.regions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {google.identity.accesscontextmanager.v1.Condition} message Condition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Condition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.ipSubnetworks = []; + object.requiredAccessLevels = []; + object.members = []; + object.regions = []; + } + if (options.defaults) { + object.devicePolicy = null; + object.negate = false; + } + if (message.ipSubnetworks && message.ipSubnetworks.length) { + object.ipSubnetworks = []; + for (var j = 0; j < message.ipSubnetworks.length; ++j) + object.ipSubnetworks[j] = message.ipSubnetworks[j]; + } + if (message.devicePolicy != null && message.hasOwnProperty("devicePolicy")) + object.devicePolicy = $root.google.identity.accesscontextmanager.v1.DevicePolicy.toObject(message.devicePolicy, options); + if (message.requiredAccessLevels && message.requiredAccessLevels.length) { + object.requiredAccessLevels = []; + for (var j = 0; j < message.requiredAccessLevels.length; ++j) + object.requiredAccessLevels[j] = message.requiredAccessLevels[j]; + } + if (message.negate != null && message.hasOwnProperty("negate")) + object.negate = message.negate; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.regions && message.regions.length) { + object.regions = []; + for (var j = 0; j < message.regions.length; ++j) + object.regions[j] = message.regions[j]; + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.Condition + * @instance + * @returns {Object.} JSON object + */ + Condition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Condition + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.Condition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Condition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.Condition"; + }; + + return Condition; + })(); + + v1.CustomLevel = (function() { + + /** + * Properties of a CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @interface ICustomLevel + * @property {google.type.IExpr|null} [expr] CustomLevel expr + */ + + /** + * Constructs a new CustomLevel. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a CustomLevel. + * @implements ICustomLevel + * @constructor + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + */ + function CustomLevel(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]]; + } + + /** + * CustomLevel expr. + * @member {google.type.IExpr|null|undefined} expr + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + */ + CustomLevel.prototype.expr = null; + + /** + * Creates a new CustomLevel instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel instance + */ + CustomLevel.create = function create(properties) { + return new CustomLevel(properties); + }; + + /** + * Encodes the specified CustomLevel message. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expr != null && Object.hasOwnProperty.call(message, "expr")) + $root.google.type.Expr.encode(message.expr, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomLevel message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.CustomLevel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.ICustomLevel} message CustomLevel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomLevel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomLevel message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.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.identity.accesscontextmanager.v1.CustomLevel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.expr = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomLevel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomLevel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomLevel message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomLevel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expr != null && message.hasOwnProperty("expr")) { + var error = $root.google.type.Expr.verify(message.expr); + if (error) + return "expr." + error; + } + return null; + }; + + /** + * Creates a CustomLevel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.CustomLevel} CustomLevel + */ + CustomLevel.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.CustomLevel) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.CustomLevel(); + if (object.expr != null) { + if (typeof object.expr !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.CustomLevel.expr: object expected"); + message.expr = $root.google.type.Expr.fromObject(object.expr); + } + return message; + }; + + /** + * Creates a plain object from a CustomLevel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {google.identity.accesscontextmanager.v1.CustomLevel} message CustomLevel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomLevel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.expr = null; + if (message.expr != null && message.hasOwnProperty("expr")) + object.expr = $root.google.type.Expr.toObject(message.expr, options); + return object; + }; + + /** + * Converts this CustomLevel to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @instance + * @returns {Object.} JSON object + */ + CustomLevel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomLevel + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.CustomLevel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomLevel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.CustomLevel"; + }; + + return CustomLevel; + })(); + + v1.DevicePolicy = (function() { + + /** + * Properties of a DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IDevicePolicy + * @property {boolean|null} [requireScreenlock] DevicePolicy requireScreenlock + * @property {Array.|null} [allowedEncryptionStatuses] DevicePolicy allowedEncryptionStatuses + * @property {Array.|null} [osConstraints] DevicePolicy osConstraints + * @property {Array.|null} [allowedDeviceManagementLevels] DevicePolicy allowedDeviceManagementLevels + * @property {boolean|null} [requireAdminApproval] DevicePolicy requireAdminApproval + * @property {boolean|null} [requireCorpOwned] DevicePolicy requireCorpOwned + */ + + /** + * Constructs a new DevicePolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a DevicePolicy. + * @implements IDevicePolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + */ + function DevicePolicy(properties) { + this.allowedEncryptionStatuses = []; + this.osConstraints = []; + this.allowedDeviceManagementLevels = []; + 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]]; + } + + /** + * DevicePolicy requireScreenlock. + * @member {boolean} requireScreenlock + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireScreenlock = false; + + /** + * DevicePolicy allowedEncryptionStatuses. + * @member {Array.} allowedEncryptionStatuses + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedEncryptionStatuses = $util.emptyArray; + + /** + * DevicePolicy osConstraints. + * @member {Array.} osConstraints + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.osConstraints = $util.emptyArray; + + /** + * DevicePolicy allowedDeviceManagementLevels. + * @member {Array.} allowedDeviceManagementLevels + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.allowedDeviceManagementLevels = $util.emptyArray; + + /** + * DevicePolicy requireAdminApproval. + * @member {boolean} requireAdminApproval + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireAdminApproval = false; + + /** + * DevicePolicy requireCorpOwned. + * @member {boolean} requireCorpOwned + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + */ + DevicePolicy.prototype.requireCorpOwned = false; + + /** + * Creates a new DevicePolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy instance + */ + DevicePolicy.create = function create(properties) { + return new DevicePolicy(properties); + }; + + /** + * Encodes the specified DevicePolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.requireScreenlock != null && Object.hasOwnProperty.call(message, "requireScreenlock")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.requireScreenlock); + if (message.allowedEncryptionStatuses != null && message.allowedEncryptionStatuses.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + writer.int32(message.allowedEncryptionStatuses[i]); + writer.ldelim(); + } + if (message.osConstraints != null && message.osConstraints.length) + for (var i = 0; i < message.osConstraints.length; ++i) + $root.google.identity.accesscontextmanager.v1.OsConstraint.encode(message.osConstraints[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.allowedDeviceManagementLevels != null && message.allowedDeviceManagementLevels.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + writer.int32(message.allowedDeviceManagementLevels[i]); + writer.ldelim(); + } + if (message.requireAdminApproval != null && Object.hasOwnProperty.call(message, "requireAdminApproval")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.requireAdminApproval); + if (message.requireCorpOwned != null && Object.hasOwnProperty.call(message, "requireCorpOwned")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.requireCorpOwned); + return writer; + }; + + /** + * Encodes the specified DevicePolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.DevicePolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IDevicePolicy} message DevicePolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DevicePolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.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.identity.accesscontextmanager.v1.DevicePolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.requireScreenlock = reader.bool(); + break; + } + case 2: { + if (!(message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length)) + message.allowedEncryptionStatuses = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedEncryptionStatuses.push(reader.int32()); + } else + message.allowedEncryptionStatuses.push(reader.int32()); + break; + } + case 3: { + if (!(message.osConstraints && message.osConstraints.length)) + message.osConstraints = []; + message.osConstraints.push($root.google.identity.accesscontextmanager.v1.OsConstraint.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length)) + message.allowedDeviceManagementLevels = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.allowedDeviceManagementLevels.push(reader.int32()); + } else + message.allowedDeviceManagementLevels.push(reader.int32()); + break; + } + case 7: { + message.requireAdminApproval = reader.bool(); + break; + } + case 8: { + message.requireCorpOwned = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DevicePolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DevicePolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DevicePolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DevicePolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + if (typeof message.requireScreenlock !== "boolean") + return "requireScreenlock: boolean expected"; + if (message.allowedEncryptionStatuses != null && message.hasOwnProperty("allowedEncryptionStatuses")) { + if (!Array.isArray(message.allowedEncryptionStatuses)) + return "allowedEncryptionStatuses: array expected"; + for (var i = 0; i < message.allowedEncryptionStatuses.length; ++i) + switch (message.allowedEncryptionStatuses[i]) { + default: + return "allowedEncryptionStatuses: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.osConstraints != null && message.hasOwnProperty("osConstraints")) { + if (!Array.isArray(message.osConstraints)) + return "osConstraints: array expected"; + for (var i = 0; i < message.osConstraints.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.OsConstraint.verify(message.osConstraints[i]); + if (error) + return "osConstraints." + error; + } + } + if (message.allowedDeviceManagementLevels != null && message.hasOwnProperty("allowedDeviceManagementLevels")) { + if (!Array.isArray(message.allowedDeviceManagementLevels)) + return "allowedDeviceManagementLevels: array expected"; + for (var i = 0; i < message.allowedDeviceManagementLevels.length; ++i) + switch (message.allowedDeviceManagementLevels[i]) { + default: + return "allowedDeviceManagementLevels: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + if (typeof message.requireAdminApproval !== "boolean") + return "requireAdminApproval: boolean expected"; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + if (typeof message.requireCorpOwned !== "boolean") + return "requireCorpOwned: boolean expected"; + return null; + }; + + /** + * Creates a DevicePolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.DevicePolicy} DevicePolicy + */ + DevicePolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.DevicePolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.DevicePolicy(); + if (object.requireScreenlock != null) + message.requireScreenlock = Boolean(object.requireScreenlock); + if (object.allowedEncryptionStatuses) { + if (!Array.isArray(object.allowedEncryptionStatuses)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedEncryptionStatuses: array expected"); + message.allowedEncryptionStatuses = []; + for (var i = 0; i < object.allowedEncryptionStatuses.length; ++i) + switch (object.allowedEncryptionStatuses[i]) { + default: + if (typeof object.allowedEncryptionStatuses[i] === "number") { + message.allowedEncryptionStatuses[i] = object.allowedEncryptionStatuses[i]; + break; + } + case "ENCRYPTION_UNSPECIFIED": + case 0: + message.allowedEncryptionStatuses[i] = 0; + break; + case "ENCRYPTION_UNSUPPORTED": + case 1: + message.allowedEncryptionStatuses[i] = 1; + break; + case "UNENCRYPTED": + case 2: + message.allowedEncryptionStatuses[i] = 2; + break; + case "ENCRYPTED": + case 3: + message.allowedEncryptionStatuses[i] = 3; + break; + } + } + if (object.osConstraints) { + if (!Array.isArray(object.osConstraints)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: array expected"); + message.osConstraints = []; + for (var i = 0; i < object.osConstraints.length; ++i) { + if (typeof object.osConstraints[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.osConstraints: object expected"); + message.osConstraints[i] = $root.google.identity.accesscontextmanager.v1.OsConstraint.fromObject(object.osConstraints[i]); + } + } + if (object.allowedDeviceManagementLevels) { + if (!Array.isArray(object.allowedDeviceManagementLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.DevicePolicy.allowedDeviceManagementLevels: array expected"); + message.allowedDeviceManagementLevels = []; + for (var i = 0; i < object.allowedDeviceManagementLevels.length; ++i) + switch (object.allowedDeviceManagementLevels[i]) { + default: + if (typeof object.allowedDeviceManagementLevels[i] === "number") { + message.allowedDeviceManagementLevels[i] = object.allowedDeviceManagementLevels[i]; + break; + } + case "MANAGEMENT_UNSPECIFIED": + case 0: + message.allowedDeviceManagementLevels[i] = 0; + break; + case "NONE": + case 1: + message.allowedDeviceManagementLevels[i] = 1; + break; + case "BASIC": + case 2: + message.allowedDeviceManagementLevels[i] = 2; + break; + case "COMPLETE": + case 3: + message.allowedDeviceManagementLevels[i] = 3; + break; + } + } + if (object.requireAdminApproval != null) + message.requireAdminApproval = Boolean(object.requireAdminApproval); + if (object.requireCorpOwned != null) + message.requireCorpOwned = Boolean(object.requireCorpOwned); + return message; + }; + + /** + * Creates a plain object from a DevicePolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {google.identity.accesscontextmanager.v1.DevicePolicy} message DevicePolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DevicePolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.allowedEncryptionStatuses = []; + object.osConstraints = []; + object.allowedDeviceManagementLevels = []; + } + if (options.defaults) { + object.requireScreenlock = false; + object.requireAdminApproval = false; + object.requireCorpOwned = false; + } + if (message.requireScreenlock != null && message.hasOwnProperty("requireScreenlock")) + object.requireScreenlock = message.requireScreenlock; + if (message.allowedEncryptionStatuses && message.allowedEncryptionStatuses.length) { + object.allowedEncryptionStatuses = []; + for (var j = 0; j < message.allowedEncryptionStatuses.length; ++j) + object.allowedEncryptionStatuses[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] === undefined ? message.allowedEncryptionStatuses[j] : $root.google.identity.accesscontextmanager.type.DeviceEncryptionStatus[message.allowedEncryptionStatuses[j]] : message.allowedEncryptionStatuses[j]; + } + if (message.osConstraints && message.osConstraints.length) { + object.osConstraints = []; + for (var j = 0; j < message.osConstraints.length; ++j) + object.osConstraints[j] = $root.google.identity.accesscontextmanager.v1.OsConstraint.toObject(message.osConstraints[j], options); + } + if (message.allowedDeviceManagementLevels && message.allowedDeviceManagementLevels.length) { + object.allowedDeviceManagementLevels = []; + for (var j = 0; j < message.allowedDeviceManagementLevels.length; ++j) + object.allowedDeviceManagementLevels[j] = options.enums === String ? $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] === undefined ? message.allowedDeviceManagementLevels[j] : $root.google.identity.accesscontextmanager.type.DeviceManagementLevel[message.allowedDeviceManagementLevels[j]] : message.allowedDeviceManagementLevels[j]; + } + if (message.requireAdminApproval != null && message.hasOwnProperty("requireAdminApproval")) + object.requireAdminApproval = message.requireAdminApproval; + if (message.requireCorpOwned != null && message.hasOwnProperty("requireCorpOwned")) + object.requireCorpOwned = message.requireCorpOwned; + return object; + }; + + /** + * Converts this DevicePolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @instance + * @returns {Object.} JSON object + */ + DevicePolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DevicePolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.DevicePolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DevicePolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.DevicePolicy"; + }; + + return DevicePolicy; + })(); + + v1.OsConstraint = (function() { + + /** + * Properties of an OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IOsConstraint + * @property {google.identity.accesscontextmanager.type.OsType|null} [osType] OsConstraint osType + * @property {string|null} [minimumVersion] OsConstraint minimumVersion + * @property {boolean|null} [requireVerifiedChromeOs] OsConstraint requireVerifiedChromeOs + */ + + /** + * Constructs a new OsConstraint. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an OsConstraint. + * @implements IOsConstraint + * @constructor + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + */ + function OsConstraint(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]]; + } + + /** + * OsConstraint osType. + * @member {google.identity.accesscontextmanager.type.OsType} osType + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.osType = 0; + + /** + * OsConstraint minimumVersion. + * @member {string} minimumVersion + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.minimumVersion = ""; + + /** + * OsConstraint requireVerifiedChromeOs. + * @member {boolean} requireVerifiedChromeOs + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + */ + OsConstraint.prototype.requireVerifiedChromeOs = false; + + /** + * Creates a new OsConstraint instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint instance + */ + OsConstraint.create = function create(properties) { + return new OsConstraint(properties); + }; + + /** + * Encodes the specified OsConstraint message. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.osType != null && Object.hasOwnProperty.call(message, "osType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.osType); + if (message.minimumVersion != null && Object.hasOwnProperty.call(message, "minimumVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.minimumVersion); + if (message.requireVerifiedChromeOs != null && Object.hasOwnProperty.call(message, "requireVerifiedChromeOs")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requireVerifiedChromeOs); + return writer; + }; + + /** + * Encodes the specified OsConstraint message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.OsConstraint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.IOsConstraint} message OsConstraint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OsConstraint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.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.identity.accesscontextmanager.v1.OsConstraint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.osType = reader.int32(); + break; + } + case 2: { + message.minimumVersion = reader.string(); + break; + } + case 3: { + message.requireVerifiedChromeOs = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OsConstraint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OsConstraint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OsConstraint message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OsConstraint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.osType != null && message.hasOwnProperty("osType")) + switch (message.osType) { + default: + return "osType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 6: + case 4: + case 5: + break; + } + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + if (!$util.isString(message.minimumVersion)) + return "minimumVersion: string expected"; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + if (typeof message.requireVerifiedChromeOs !== "boolean") + return "requireVerifiedChromeOs: boolean expected"; + return null; + }; + + /** + * Creates an OsConstraint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.OsConstraint} OsConstraint + */ + OsConstraint.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.OsConstraint) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.OsConstraint(); + switch (object.osType) { + default: + if (typeof object.osType === "number") { + message.osType = object.osType; + break; + } + break; + case "OS_UNSPECIFIED": + case 0: + message.osType = 0; + break; + case "DESKTOP_MAC": + case 1: + message.osType = 1; + break; + case "DESKTOP_WINDOWS": + case 2: + message.osType = 2; + break; + case "DESKTOP_LINUX": + case 3: + message.osType = 3; + break; + case "DESKTOP_CHROME_OS": + case 6: + message.osType = 6; + break; + case "ANDROID": + case 4: + message.osType = 4; + break; + case "IOS": + case 5: + message.osType = 5; + break; + } + if (object.minimumVersion != null) + message.minimumVersion = String(object.minimumVersion); + if (object.requireVerifiedChromeOs != null) + message.requireVerifiedChromeOs = Boolean(object.requireVerifiedChromeOs); + return message; + }; + + /** + * Creates a plain object from an OsConstraint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {google.identity.accesscontextmanager.v1.OsConstraint} message OsConstraint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OsConstraint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.osType = options.enums === String ? "OS_UNSPECIFIED" : 0; + object.minimumVersion = ""; + object.requireVerifiedChromeOs = false; + } + if (message.osType != null && message.hasOwnProperty("osType")) + object.osType = options.enums === String ? $root.google.identity.accesscontextmanager.type.OsType[message.osType] === undefined ? message.osType : $root.google.identity.accesscontextmanager.type.OsType[message.osType] : message.osType; + if (message.minimumVersion != null && message.hasOwnProperty("minimumVersion")) + object.minimumVersion = message.minimumVersion; + if (message.requireVerifiedChromeOs != null && message.hasOwnProperty("requireVerifiedChromeOs")) + object.requireVerifiedChromeOs = message.requireVerifiedChromeOs; + return object; + }; + + /** + * Converts this OsConstraint to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @instance + * @returns {Object.} JSON object + */ + OsConstraint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OsConstraint + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.OsConstraint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OsConstraint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.OsConstraint"; + }; + + return OsConstraint; + })(); + + v1.AccessPolicy = (function() { + + /** + * Properties of an AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IAccessPolicy + * @property {string|null} [name] AccessPolicy name + * @property {string|null} [parent] AccessPolicy parent + * @property {string|null} [title] AccessPolicy title + * @property {Array.|null} [scopes] AccessPolicy scopes + * @property {google.protobuf.ITimestamp|null} [createTime] AccessPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] AccessPolicy updateTime + * @property {string|null} [etag] AccessPolicy etag + */ + + /** + * Constructs a new AccessPolicy. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents an AccessPolicy. + * @implements IAccessPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + */ + function AccessPolicy(properties) { + this.scopes = []; + 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]]; + } + + /** + * AccessPolicy name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.name = ""; + + /** + * AccessPolicy parent. + * @member {string} parent + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.parent = ""; + + /** + * AccessPolicy title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.title = ""; + + /** + * AccessPolicy scopes. + * @member {Array.} scopes + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.scopes = $util.emptyArray; + + /** + * AccessPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.createTime = null; + + /** + * AccessPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.updateTime = null; + + /** + * AccessPolicy etag. + * @member {string} etag + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + */ + AccessPolicy.prototype.etag = ""; + + /** + * Creates a new AccessPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy instance + */ + AccessPolicy.create = function create(properties) { + return new AccessPolicy(properties); + }; + + /** + * Encodes the specified AccessPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parent); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified AccessPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.AccessPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.IAccessPolicy} message AccessPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.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.identity.accesscontextmanager.v1.AccessPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.parent = reader.string(); + break; + } + case 3: { + message.title = reader.string(); + break; + } + case 7: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates an AccessPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.AccessPolicy} AccessPolicy + */ + AccessPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.AccessPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.AccessPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.parent != null) + message.parent = String(object.parent); + if (object.title != null) + message.title = String(object.title); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.AccessPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from an AccessPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.AccessPolicy} message AccessPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (options.defaults) { + object.name = ""; + object.parent = ""; + object.title = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this AccessPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @instance + * @returns {Object.} JSON object + */ + AccessPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.AccessPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.AccessPolicy"; + }; + + return AccessPolicy; + })(); + + v1.ServicePerimeter = (function() { + + /** + * Properties of a ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeter + * @property {string|null} [name] ServicePerimeter name + * @property {string|null} [title] ServicePerimeter title + * @property {string|null} [description] ServicePerimeter description + * @property {google.protobuf.ITimestamp|null} [createTime] ServicePerimeter createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ServicePerimeter updateTime + * @property {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType|null} [perimeterType] ServicePerimeter perimeterType + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [status] ServicePerimeter status + * @property {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null} [spec] ServicePerimeter spec + * @property {boolean|null} [useExplicitDryRunSpec] ServicePerimeter useExplicitDryRunSpec + */ + + /** + * Constructs a new ServicePerimeter. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeter. + * @implements IServicePerimeter + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + */ + function ServicePerimeter(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]]; + } + + /** + * ServicePerimeter name. + * @member {string} name + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.name = ""; + + /** + * ServicePerimeter title. + * @member {string} title + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.title = ""; + + /** + * ServicePerimeter description. + * @member {string} description + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.description = ""; + + /** + * ServicePerimeter createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.createTime = null; + + /** + * ServicePerimeter updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.updateTime = null; + + /** + * ServicePerimeter perimeterType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType} perimeterType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.perimeterType = 0; + + /** + * ServicePerimeter status. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} status + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.status = null; + + /** + * ServicePerimeter spec. + * @member {google.identity.accesscontextmanager.v1.IServicePerimeterConfig|null|undefined} spec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.spec = null; + + /** + * ServicePerimeter useExplicitDryRunSpec. + * @member {boolean} useExplicitDryRunSpec + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + */ + ServicePerimeter.prototype.useExplicitDryRunSpec = false; + + /** + * Creates a new ServicePerimeter instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter instance + */ + ServicePerimeter.create = function create(properties) { + return new ServicePerimeter(properties); + }; + + /** + * Encodes the specified ServicePerimeter message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.perimeterType != null && Object.hasOwnProperty.call(message, "perimeterType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.perimeterType); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.status, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.encode(message.spec, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.useExplicitDryRunSpec != null && Object.hasOwnProperty.call(message, "useExplicitDryRunSpec")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.useExplicitDryRunSpec); + return writer; + }; + + /** + * Encodes the specified ServicePerimeter message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeter} message ServicePerimeter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.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.identity.accesscontextmanager.v1.ServicePerimeter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.perimeterType = reader.int32(); + break; + } + case 7: { + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.useExplicitDryRunSpec = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServicePerimeter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServicePerimeter message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeter.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.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + switch (message.perimeterType) { + default: + return "perimeterType: enum value expected"; + case 0: + case 1: + break; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.status); + if (error) + return "status." + error; + } + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify(message.spec); + if (error) + return "spec." + error; + } + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + if (typeof message.useExplicitDryRunSpec !== "boolean") + return "useExplicitDryRunSpec: boolean expected"; + return null; + }; + + /** + * Creates a ServicePerimeter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeter} ServicePerimeter + */ + ServicePerimeter.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeter) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeter(); + if (object.name != null) + message.name = String(object.name); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.perimeterType) { + default: + if (typeof object.perimeterType === "number") { + message.perimeterType = object.perimeterType; + break; + } + break; + case "PERIMETER_TYPE_REGULAR": + case 0: + message.perimeterType = 0; + break; + case "PERIMETER_TYPE_BRIDGE": + case 1: + message.perimeterType = 1; + break; + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.status: object expected"); + message.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.status); + } + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeter.spec: object expected"); + message.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.fromObject(object.spec); + } + if (object.useExplicitDryRunSpec != null) + message.useExplicitDryRunSpec = Boolean(object.useExplicitDryRunSpec); + return message; + }; + + /** + * Creates a plain object from a ServicePerimeter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeter} message ServicePerimeter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.title = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.perimeterType = options.enums === String ? "PERIMETER_TYPE_REGULAR" : 0; + object.status = null; + object.spec = null; + object.useExplicitDryRunSpec = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.perimeterType != null && message.hasOwnProperty("perimeterType")) + object.perimeterType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] === undefined ? message.perimeterType : $root.google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType[message.perimeterType] : message.perimeterType; + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.status, options); + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.toObject(message.spec, options); + if (message.useExplicitDryRunSpec != null && message.hasOwnProperty("useExplicitDryRunSpec")) + object.useExplicitDryRunSpec = message.useExplicitDryRunSpec; + return object; + }; + + /** + * Converts this ServicePerimeter to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServicePerimeter + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeter"; + }; + + /** + * PerimeterType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType + * @enum {number} + * @property {number} PERIMETER_TYPE_REGULAR=0 PERIMETER_TYPE_REGULAR value + * @property {number} PERIMETER_TYPE_BRIDGE=1 PERIMETER_TYPE_BRIDGE value + */ + ServicePerimeter.PerimeterType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PERIMETER_TYPE_REGULAR"] = 0; + values[valuesById[1] = "PERIMETER_TYPE_BRIDGE"] = 1; + return values; + })(); + + return ServicePerimeter; + })(); + + v1.ServicePerimeterConfig = (function() { + + /** + * Properties of a ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @interface IServicePerimeterConfig + * @property {Array.|null} [resources] ServicePerimeterConfig resources + * @property {Array.|null} [accessLevels] ServicePerimeterConfig accessLevels + * @property {Array.|null} [restrictedServices] ServicePerimeterConfig restrictedServices + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null} [vpcAccessibleServices] ServicePerimeterConfig vpcAccessibleServices + * @property {Array.|null} [ingressPolicies] ServicePerimeterConfig ingressPolicies + * @property {Array.|null} [egressPolicies] ServicePerimeterConfig egressPolicies + */ + + /** + * Constructs a new ServicePerimeterConfig. + * @memberof google.identity.accesscontextmanager.v1 + * @classdesc Represents a ServicePerimeterConfig. + * @implements IServicePerimeterConfig + * @constructor + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + */ + function ServicePerimeterConfig(properties) { + this.resources = []; + this.accessLevels = []; + this.restrictedServices = []; + this.ingressPolicies = []; + this.egressPolicies = []; + 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]]; + } + + /** + * ServicePerimeterConfig resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.resources = $util.emptyArray; + + /** + * ServicePerimeterConfig accessLevels. + * @member {Array.} accessLevels + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.accessLevels = $util.emptyArray; + + /** + * ServicePerimeterConfig restrictedServices. + * @member {Array.} restrictedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.restrictedServices = $util.emptyArray; + + /** + * ServicePerimeterConfig vpcAccessibleServices. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices|null|undefined} vpcAccessibleServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.vpcAccessibleServices = null; + + /** + * ServicePerimeterConfig ingressPolicies. + * @member {Array.} ingressPolicies + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.ingressPolicies = $util.emptyArray; + + /** + * ServicePerimeterConfig egressPolicies. + * @member {Array.} egressPolicies + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + */ + ServicePerimeterConfig.prototype.egressPolicies = $util.emptyArray; + + /** + * Creates a new ServicePerimeterConfig instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig instance + */ + ServicePerimeterConfig.create = function create(properties) { + return new ServicePerimeterConfig(properties); + }; + + /** + * Encodes the specified ServicePerimeterConfig message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.accessLevels != null && message.accessLevels.length) + for (var i = 0; i < message.accessLevels.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessLevels[i]); + if (message.restrictedServices != null && message.restrictedServices.length) + for (var i = 0; i < message.restrictedServices.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.restrictedServices[i]); + if (message.ingressPolicies != null && message.ingressPolicies.length) + for (var i = 0; i < message.ingressPolicies.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.encode(message.ingressPolicies[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.egressPolicies != null && message.egressPolicies.length) + for (var i = 0; i < message.egressPolicies.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.encode(message.egressPolicies[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.vpcAccessibleServices != null && Object.hasOwnProperty.call(message, "vpcAccessibleServices")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.encode(message.vpcAccessibleServices, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServicePerimeterConfig message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.IServicePerimeterConfig} message ServicePerimeterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServicePerimeterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.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.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.accessLevels && message.accessLevels.length)) + message.accessLevels = []; + message.accessLevels.push(reader.string()); + break; + } + case 4: { + if (!(message.restrictedServices && message.restrictedServices.length)) + message.restrictedServices = []; + message.restrictedServices.push(reader.string()); + break; + } + case 10: { + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.ingressPolicies && message.ingressPolicies.length)) + message.ingressPolicies = []; + message.ingressPolicies.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.egressPolicies && message.egressPolicies.length)) + message.egressPolicies = []; + message.egressPolicies.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServicePerimeterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServicePerimeterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServicePerimeterConfig message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServicePerimeterConfig.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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.accessLevels != null && message.hasOwnProperty("accessLevels")) { + if (!Array.isArray(message.accessLevels)) + return "accessLevels: array expected"; + for (var i = 0; i < message.accessLevels.length; ++i) + if (!$util.isString(message.accessLevels[i])) + return "accessLevels: string[] expected"; + } + if (message.restrictedServices != null && message.hasOwnProperty("restrictedServices")) { + if (!Array.isArray(message.restrictedServices)) + return "restrictedServices: array expected"; + for (var i = 0; i < message.restrictedServices.length; ++i) + if (!$util.isString(message.restrictedServices[i])) + return "restrictedServices: string[] expected"; + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify(message.vpcAccessibleServices); + if (error) + return "vpcAccessibleServices." + error; + } + if (message.ingressPolicies != null && message.hasOwnProperty("ingressPolicies")) { + if (!Array.isArray(message.ingressPolicies)) + return "ingressPolicies: array expected"; + for (var i = 0; i < message.ingressPolicies.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify(message.ingressPolicies[i]); + if (error) + return "ingressPolicies." + error; + } + } + if (message.egressPolicies != null && message.hasOwnProperty("egressPolicies")) { + if (!Array.isArray(message.egressPolicies)) + return "egressPolicies: array expected"; + for (var i = 0; i < message.egressPolicies.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify(message.egressPolicies[i]); + if (error) + return "egressPolicies." + error; + } + } + return null; + }; + + /** + * Creates a ServicePerimeterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} ServicePerimeterConfig + */ + ServicePerimeterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.accessLevels) { + if (!Array.isArray(object.accessLevels)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.accessLevels: array expected"); + message.accessLevels = []; + for (var i = 0; i < object.accessLevels.length; ++i) + message.accessLevels[i] = String(object.accessLevels[i]); + } + if (object.restrictedServices) { + if (!Array.isArray(object.restrictedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.restrictedServices: array expected"); + message.restrictedServices = []; + for (var i = 0; i < object.restrictedServices.length; ++i) + message.restrictedServices[i] = String(object.restrictedServices[i]); + } + if (object.vpcAccessibleServices != null) { + if (typeof object.vpcAccessibleServices !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.vpcAccessibleServices: object expected"); + message.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.fromObject(object.vpcAccessibleServices); + } + if (object.ingressPolicies) { + if (!Array.isArray(object.ingressPolicies)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ingressPolicies: array expected"); + message.ingressPolicies = []; + for (var i = 0; i < object.ingressPolicies.length; ++i) { + if (typeof object.ingressPolicies[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ingressPolicies: object expected"); + message.ingressPolicies[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.fromObject(object.ingressPolicies[i]); + } + } + if (object.egressPolicies) { + if (!Array.isArray(object.egressPolicies)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.egressPolicies: array expected"); + message.egressPolicies = []; + for (var i = 0; i < object.egressPolicies.length; ++i) { + if (typeof object.egressPolicies[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.egressPolicies: object expected"); + message.egressPolicies[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.fromObject(object.egressPolicies[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ServicePerimeterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig} message ServicePerimeterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServicePerimeterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.accessLevels = []; + object.restrictedServices = []; + object.ingressPolicies = []; + object.egressPolicies = []; + } + if (options.defaults) + object.vpcAccessibleServices = null; + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.accessLevels && message.accessLevels.length) { + object.accessLevels = []; + for (var j = 0; j < message.accessLevels.length; ++j) + object.accessLevels[j] = message.accessLevels[j]; + } + if (message.restrictedServices && message.restrictedServices.length) { + object.restrictedServices = []; + for (var j = 0; j < message.restrictedServices.length; ++j) + object.restrictedServices[j] = message.restrictedServices[j]; + } + if (message.ingressPolicies && message.ingressPolicies.length) { + object.ingressPolicies = []; + for (var j = 0; j < message.ingressPolicies.length; ++j) + object.ingressPolicies[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.toObject(message.ingressPolicies[j], options); + } + if (message.egressPolicies && message.egressPolicies.length) { + object.egressPolicies = []; + for (var j = 0; j < message.egressPolicies.length; ++j) + object.egressPolicies[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.toObject(message.egressPolicies[j], options); + } + if (message.vpcAccessibleServices != null && message.hasOwnProperty("vpcAccessibleServices")) + object.vpcAccessibleServices = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.toObject(message.vpcAccessibleServices, options); + return object; + }; + + /** + * Converts this ServicePerimeterConfig to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @instance + * @returns {Object.} JSON object + */ + ServicePerimeterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServicePerimeterConfig + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServicePerimeterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig"; + }; + + ServicePerimeterConfig.VpcAccessibleServices = (function() { + + /** + * Properties of a VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IVpcAccessibleServices + * @property {boolean|null} [enableRestriction] VpcAccessibleServices enableRestriction + * @property {Array.|null} [allowedServices] VpcAccessibleServices allowedServices + */ + + /** + * Constructs a new VpcAccessibleServices. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a VpcAccessibleServices. + * @implements IVpcAccessibleServices + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + */ + function VpcAccessibleServices(properties) { + this.allowedServices = []; + 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]]; + } + + /** + * VpcAccessibleServices enableRestriction. + * @member {boolean} enableRestriction + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.enableRestriction = false; + + /** + * VpcAccessibleServices allowedServices. + * @member {Array.} allowedServices + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + */ + VpcAccessibleServices.prototype.allowedServices = $util.emptyArray; + + /** + * Creates a new VpcAccessibleServices instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices instance + */ + VpcAccessibleServices.create = function create(properties) { + return new VpcAccessibleServices(properties); + }; + + /** + * Encodes the specified VpcAccessibleServices message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableRestriction != null && Object.hasOwnProperty.call(message, "enableRestriction")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableRestriction); + if (message.allowedServices != null && message.allowedServices.length) + for (var i = 0; i < message.allowedServices.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedServices[i]); + return writer; + }; + + /** + * Encodes the specified VpcAccessibleServices message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IVpcAccessibleServices} message VpcAccessibleServices message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcAccessibleServices.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableRestriction = reader.bool(); + break; + } + case 2: { + if (!(message.allowedServices && message.allowedServices.length)) + message.allowedServices = []; + message.allowedServices.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcAccessibleServices message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcAccessibleServices.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcAccessibleServices message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcAccessibleServices.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + if (typeof message.enableRestriction !== "boolean") + return "enableRestriction: boolean expected"; + if (message.allowedServices != null && message.hasOwnProperty("allowedServices")) { + if (!Array.isArray(message.allowedServices)) + return "allowedServices: array expected"; + for (var i = 0; i < message.allowedServices.length; ++i) + if (!$util.isString(message.allowedServices[i])) + return "allowedServices: string[] expected"; + } + return null; + }; + + /** + * Creates a VpcAccessibleServices message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} VpcAccessibleServices + */ + VpcAccessibleServices.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices(); + if (object.enableRestriction != null) + message.enableRestriction = Boolean(object.enableRestriction); + if (object.allowedServices) { + if (!Array.isArray(object.allowedServices)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices.allowedServices: array expected"); + message.allowedServices = []; + for (var i = 0; i < object.allowedServices.length; ++i) + message.allowedServices[i] = String(object.allowedServices[i]); + } + return message; + }; + + /** + * Creates a plain object from a VpcAccessibleServices message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices} message VpcAccessibleServices + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcAccessibleServices.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedServices = []; + if (options.defaults) + object.enableRestriction = false; + if (message.enableRestriction != null && message.hasOwnProperty("enableRestriction")) + object.enableRestriction = message.enableRestriction; + if (message.allowedServices && message.allowedServices.length) { + object.allowedServices = []; + for (var j = 0; j < message.allowedServices.length; ++j) + object.allowedServices[j] = message.allowedServices[j]; + } + return object; + }; + + /** + * Converts this VpcAccessibleServices to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @instance + * @returns {Object.} JSON object + */ + VpcAccessibleServices.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcAccessibleServices + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcAccessibleServices.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.VpcAccessibleServices"; + }; + + return VpcAccessibleServices; + })(); + + /** + * IdentityType enum. + * @name google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType + * @enum {number} + * @property {number} IDENTITY_TYPE_UNSPECIFIED=0 IDENTITY_TYPE_UNSPECIFIED value + * @property {number} ANY_IDENTITY=1 ANY_IDENTITY value + * @property {number} ANY_USER_ACCOUNT=2 ANY_USER_ACCOUNT value + * @property {number} ANY_SERVICE_ACCOUNT=3 ANY_SERVICE_ACCOUNT value + */ + ServicePerimeterConfig.IdentityType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDENTITY_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ANY_IDENTITY"] = 1; + values[valuesById[2] = "ANY_USER_ACCOUNT"] = 2; + values[valuesById[3] = "ANY_SERVICE_ACCOUNT"] = 3; + return values; + })(); + + ServicePerimeterConfig.MethodSelector = (function() { + + /** + * Properties of a MethodSelector. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IMethodSelector + * @property {string|null} [method] MethodSelector method + * @property {string|null} [permission] MethodSelector permission + */ + + /** + * Constructs a new MethodSelector. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents a MethodSelector. + * @implements IMethodSelector + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector=} [properties] Properties to set + */ + function MethodSelector(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]]; + } + + /** + * MethodSelector method. + * @member {string|null|undefined} method + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + MethodSelector.prototype.method = null; + + /** + * MethodSelector permission. + * @member {string|null|undefined} permission + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + MethodSelector.prototype.permission = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MethodSelector kind. + * @member {"method"|"permission"|undefined} kind + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + */ + Object.defineProperty(MethodSelector.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["method", "permission"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MethodSelector instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector instance + */ + MethodSelector.create = function create(properties) { + return new MethodSelector(properties); + }; + + /** + * Encodes the specified MethodSelector message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector} message MethodSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.method != null && Object.hasOwnProperty.call(message, "method")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.method); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.permission); + return writer; + }; + + /** + * Encodes the specified MethodSelector message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IMethodSelector} message MethodSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodSelector message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSelector.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.method = reader.string(); + break; + } + case 2: { + message.permission = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodSelector message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.method != null && message.hasOwnProperty("method")) { + properties.kind = 1; + if (!$util.isString(message.method)) + return "method: string expected"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.permission)) + return "permission: string expected"; + } + return null; + }; + + /** + * Creates a MethodSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} MethodSelector + */ + MethodSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector(); + if (object.method != null) + message.method = String(object.method); + if (object.permission != null) + message.permission = String(object.permission); + return message; + }; + + /** + * Creates a plain object from a MethodSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector} message MethodSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.method != null && message.hasOwnProperty("method")) { + object.method = message.method; + if (options.oneofs) + object.kind = "method"; + } + if (message.permission != null && message.hasOwnProperty("permission")) { + object.permission = message.permission; + if (options.oneofs) + object.kind = "permission"; + } + return object; + }; + + /** + * Converts this MethodSelector to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @instance + * @returns {Object.} JSON object + */ + MethodSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodSelector + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector"; + }; + + return MethodSelector; + })(); + + ServicePerimeterConfig.ApiOperation = (function() { + + /** + * Properties of an ApiOperation. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IApiOperation + * @property {string|null} [serviceName] ApiOperation serviceName + * @property {Array.|null} [methodSelectors] ApiOperation methodSelectors + */ + + /** + * Constructs a new ApiOperation. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an ApiOperation. + * @implements IApiOperation + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation=} [properties] Properties to set + */ + function ApiOperation(properties) { + this.methodSelectors = []; + 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]]; + } + + /** + * ApiOperation serviceName. + * @member {string} serviceName + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + */ + ApiOperation.prototype.serviceName = ""; + + /** + * ApiOperation methodSelectors. + * @member {Array.} methodSelectors + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + */ + ApiOperation.prototype.methodSelectors = $util.emptyArray; + + /** + * Creates a new ApiOperation instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation instance + */ + ApiOperation.create = function create(properties) { + return new ApiOperation(properties); + }; + + /** + * Encodes the specified ApiOperation message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serviceName != null && Object.hasOwnProperty.call(message, "serviceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.serviceName); + if (message.methodSelectors != null && message.methodSelectors.length) + for (var i = 0; i < message.methodSelectors.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.encode(message.methodSelectors[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiOperation message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IApiOperation} message ApiOperation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiOperation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.serviceName = reader.string(); + break; + } + case 2: { + if (!(message.methodSelectors && message.methodSelectors.length)) + message.methodSelectors = []; + message.methodSelectors.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiOperation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiOperation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiOperation message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiOperation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + if (!$util.isString(message.serviceName)) + return "serviceName: string expected"; + if (message.methodSelectors != null && message.hasOwnProperty("methodSelectors")) { + if (!Array.isArray(message.methodSelectors)) + return "methodSelectors: array expected"; + for (var i = 0; i < message.methodSelectors.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.verify(message.methodSelectors[i]); + if (error) + return "methodSelectors." + error; + } + } + return null; + }; + + /** + * Creates an ApiOperation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} ApiOperation + */ + ApiOperation.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation(); + if (object.serviceName != null) + message.serviceName = String(object.serviceName); + if (object.methodSelectors) { + if (!Array.isArray(object.methodSelectors)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.methodSelectors: array expected"); + message.methodSelectors = []; + for (var i = 0; i < object.methodSelectors.length; ++i) { + if (typeof object.methodSelectors[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.methodSelectors: object expected"); + message.methodSelectors[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.fromObject(object.methodSelectors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ApiOperation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation} message ApiOperation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiOperation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.methodSelectors = []; + if (options.defaults) + object.serviceName = ""; + if (message.serviceName != null && message.hasOwnProperty("serviceName")) + object.serviceName = message.serviceName; + if (message.methodSelectors && message.methodSelectors.length) { + object.methodSelectors = []; + for (var j = 0; j < message.methodSelectors.length; ++j) + object.methodSelectors[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector.toObject(message.methodSelectors[j], options); + } + return object; + }; + + /** + * Converts this ApiOperation to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @instance + * @returns {Object.} JSON object + */ + ApiOperation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiOperation + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiOperation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation"; + }; + + return ApiOperation; + })(); + + ServicePerimeterConfig.IngressSource = (function() { + + /** + * Properties of an IngressSource. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressSource + * @property {string|null} [accessLevel] IngressSource accessLevel + * @property {string|null} [resource] IngressSource resource + */ + + /** + * Constructs a new IngressSource. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressSource. + * @implements IIngressSource + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource=} [properties] Properties to set + */ + function IngressSource(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]]; + } + + /** + * IngressSource accessLevel. + * @member {string|null|undefined} accessLevel + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + IngressSource.prototype.accessLevel = null; + + /** + * IngressSource resource. + * @member {string|null|undefined} resource + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + IngressSource.prototype.resource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * IngressSource source. + * @member {"accessLevel"|"resource"|undefined} source + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + */ + Object.defineProperty(IngressSource.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["accessLevel", "resource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new IngressSource instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource instance + */ + IngressSource.create = function create(properties) { + return new IngressSource(properties); + }; + + /** + * Encodes the specified IngressSource message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource} message IngressSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessLevel != null && Object.hasOwnProperty.call(message, "accessLevel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessLevel); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resource); + return writer; + }; + + /** + * Encodes the specified IngressSource message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressSource} message IngressSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressSource message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressSource.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessLevel = reader.string(); + break; + } + case 2: { + message.resource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressSource message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + properties.source = 1; + if (!$util.isString(message.accessLevel)) + return "accessLevel: string expected"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.resource)) + return "resource: string expected"; + } + return null; + }; + + /** + * Creates an IngressSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} IngressSource + */ + IngressSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource(); + if (object.accessLevel != null) + message.accessLevel = String(object.accessLevel); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from an IngressSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource} message IngressSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.accessLevel != null && message.hasOwnProperty("accessLevel")) { + object.accessLevel = message.accessLevel; + if (options.oneofs) + object.source = "accessLevel"; + } + if (message.resource != null && message.hasOwnProperty("resource")) { + object.resource = message.resource; + if (options.oneofs) + object.source = "resource"; + } + return object; + }; + + /** + * Converts this IngressSource to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @instance + * @returns {Object.} JSON object + */ + IngressSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressSource + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource"; + }; + + return IngressSource; + })(); + + ServicePerimeterConfig.IngressFrom = (function() { + + /** + * Properties of an IngressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressFrom + * @property {Array.|null} [sources] IngressFrom sources + * @property {Array.|null} [identities] IngressFrom identities + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null} [identityType] IngressFrom identityType + */ + + /** + * Constructs a new IngressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressFrom. + * @implements IIngressFrom + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom=} [properties] Properties to set + */ + function IngressFrom(properties) { + this.sources = []; + this.identities = []; + 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]]; + } + + /** + * IngressFrom sources. + * @member {Array.} sources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.sources = $util.emptyArray; + + /** + * IngressFrom identities. + * @member {Array.} identities + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.identities = $util.emptyArray; + + /** + * IngressFrom identityType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType} identityType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + */ + IngressFrom.prototype.identityType = 0; + + /** + * Creates a new IngressFrom instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom instance + */ + IngressFrom.create = function create(properties) { + return new IngressFrom(properties); + }; + + /** + * Encodes the specified IngressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom} message IngressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressFrom.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sources != null && message.sources.length) + for (var i = 0; i < message.sources.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.encode(message.sources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.identities[i]); + if (message.identityType != null && Object.hasOwnProperty.call(message, "identityType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.identityType); + return writer; + }; + + /** + * Encodes the specified IngressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom} message IngressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressFrom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressFrom message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressFrom.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.sources && message.sources.length)) + message.sources = []; + message.sources.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.string()); + break; + } + case 3: { + message.identityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressFrom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressFrom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressFrom message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressFrom.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sources != null && message.hasOwnProperty("sources")) { + if (!Array.isArray(message.sources)) + return "sources: array expected"; + for (var i = 0; i < message.sources.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.verify(message.sources[i]); + if (error) + return "sources." + error; + } + } + 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) + if (!$util.isString(message.identities[i])) + return "identities: string[] expected"; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + switch (message.identityType) { + default: + return "identityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an IngressFrom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} IngressFrom + */ + IngressFrom.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom(); + if (object.sources) { + if (!Array.isArray(object.sources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.sources: array expected"); + message.sources = []; + for (var i = 0; i < object.sources.length; ++i) { + if (typeof object.sources[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.sources: object expected"); + message.sources[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.fromObject(object.sources[i]); + } + } + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + message.identities[i] = String(object.identities[i]); + } + switch (object.identityType) { + default: + if (typeof object.identityType === "number") { + message.identityType = object.identityType; + break; + } + break; + case "IDENTITY_TYPE_UNSPECIFIED": + case 0: + message.identityType = 0; + break; + case "ANY_IDENTITY": + case 1: + message.identityType = 1; + break; + case "ANY_USER_ACCOUNT": + case 2: + message.identityType = 2; + break; + case "ANY_SERVICE_ACCOUNT": + case 3: + message.identityType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an IngressFrom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom} message IngressFrom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressFrom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sources = []; + object.identities = []; + } + if (options.defaults) + object.identityType = options.enums === String ? "IDENTITY_TYPE_UNSPECIFIED" : 0; + if (message.sources && message.sources.length) { + object.sources = []; + for (var j = 0; j < message.sources.length; ++j) + object.sources[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource.toObject(message.sources[j], options); + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = message.identities[j]; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + object.identityType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] === undefined ? message.identityType : $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] : message.identityType; + return object; + }; + + /** + * Converts this IngressFrom to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @instance + * @returns {Object.} JSON object + */ + IngressFrom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressFrom + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressFrom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom"; + }; + + return IngressFrom; + })(); + + ServicePerimeterConfig.IngressTo = (function() { + + /** + * Properties of an IngressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressTo + * @property {Array.|null} [operations] IngressTo operations + * @property {Array.|null} [resources] IngressTo resources + */ + + /** + * Constructs a new IngressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressTo. + * @implements IIngressTo + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo=} [properties] Properties to set + */ + function IngressTo(properties) { + this.operations = []; + this.resources = []; + 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]]; + } + + /** + * IngressTo operations. + * @member {Array.} operations + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + */ + IngressTo.prototype.operations = $util.emptyArray; + + /** + * IngressTo resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + */ + IngressTo.prototype.resources = $util.emptyArray; + + /** + * Creates a new IngressTo instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo instance + */ + IngressTo.create = function create(properties) { + return new IngressTo(properties); + }; + + /** + * Encodes the specified IngressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo} message IngressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressTo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.resources != null && message.resources.length) + for (var i = 0; i < message.resources.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resources[i]); + return writer; + }; + + /** + * Encodes the specified IngressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo} message IngressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressTo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressTo message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressTo.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressTo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressTo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressTo message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressTo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + 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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + return null; + }; + + /** + * Creates an IngressTo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} IngressTo + */ + IngressTo.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo(); + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.operations: object expected"); + message.operations[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.fromObject(object.operations[i]); + } + } + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + return message; + }; + + /** + * Creates a plain object from an IngressTo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo} message IngressTo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressTo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.operations = []; + object.resources = []; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.toObject(message.operations[j], options); + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + return object; + }; + + /** + * Converts this IngressTo to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @instance + * @returns {Object.} JSON object + */ + IngressTo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressTo + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressTo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo"; + }; + + return IngressTo; + })(); + + ServicePerimeterConfig.IngressPolicy = (function() { + + /** + * Properties of an IngressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IIngressPolicy + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null} [ingressFrom] IngressPolicy ingressFrom + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null} [ingressTo] IngressPolicy ingressTo + */ + + /** + * Constructs a new IngressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an IngressPolicy. + * @implements IIngressPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy=} [properties] Properties to set + */ + function IngressPolicy(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]]; + } + + /** + * IngressPolicy ingressFrom. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressFrom|null|undefined} ingressFrom + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + */ + IngressPolicy.prototype.ingressFrom = null; + + /** + * IngressPolicy ingressTo. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressTo|null|undefined} ingressTo + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + */ + IngressPolicy.prototype.ingressTo = null; + + /** + * Creates a new IngressPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy instance + */ + IngressPolicy.create = function create(properties) { + return new IngressPolicy(properties); + }; + + /** + * Encodes the specified IngressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy} message IngressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ingressFrom != null && Object.hasOwnProperty.call(message, "ingressFrom")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.encode(message.ingressFrom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ingressTo != null && Object.hasOwnProperty.call(message, "ingressTo")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.encode(message.ingressTo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IngressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IIngressPolicy} message IngressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IngressPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressPolicy.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.decode(reader, reader.uint32()); + break; + } + case 2: { + message.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an IngressPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IngressPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IngressPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IngressPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ingressFrom != null && message.hasOwnProperty("ingressFrom")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.verify(message.ingressFrom); + if (error) + return "ingressFrom." + error; + } + if (message.ingressTo != null && message.hasOwnProperty("ingressTo")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.verify(message.ingressTo); + if (error) + return "ingressTo." + error; + } + return null; + }; + + /** + * Creates an IngressPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} IngressPolicy + */ + IngressPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy(); + if (object.ingressFrom != null) { + if (typeof object.ingressFrom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.ingressFrom: object expected"); + message.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.fromObject(object.ingressFrom); + } + if (object.ingressTo != null) { + if (typeof object.ingressTo !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy.ingressTo: object expected"); + message.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.fromObject(object.ingressTo); + } + return message; + }; + + /** + * Creates a plain object from an IngressPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy} message IngressPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IngressPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ingressFrom = null; + object.ingressTo = null; + } + if (message.ingressFrom != null && message.hasOwnProperty("ingressFrom")) + object.ingressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom.toObject(message.ingressFrom, options); + if (message.ingressTo != null && message.hasOwnProperty("ingressTo")) + object.ingressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo.toObject(message.ingressTo, options); + return object; + }; + + /** + * Converts this IngressPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @instance + * @returns {Object.} JSON object + */ + IngressPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IngressPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IngressPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy"; + }; + + return IngressPolicy; + })(); + + ServicePerimeterConfig.EgressFrom = (function() { + + /** + * Properties of an EgressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressFrom + * @property {Array.|null} [identities] EgressFrom identities + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType|null} [identityType] EgressFrom identityType + */ + + /** + * Constructs a new EgressFrom. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressFrom. + * @implements IEgressFrom + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom=} [properties] Properties to set + */ + function EgressFrom(properties) { + this.identities = []; + 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]]; + } + + /** + * EgressFrom identities. + * @member {Array.} identities + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + */ + EgressFrom.prototype.identities = $util.emptyArray; + + /** + * EgressFrom identityType. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType} identityType + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + */ + EgressFrom.prototype.identityType = 0; + + /** + * Creates a new EgressFrom instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom instance + */ + EgressFrom.create = function create(properties) { + return new EgressFrom(properties); + }; + + /** + * Encodes the specified EgressFrom message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom} message EgressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressFrom.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.identities[i]); + if (message.identityType != null && Object.hasOwnProperty.call(message, "identityType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.identityType); + return writer; + }; + + /** + * Encodes the specified EgressFrom message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom} message EgressFrom message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressFrom.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressFrom message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressFrom.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.string()); + break; + } + case 2: { + message.identityType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressFrom message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressFrom.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressFrom message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressFrom.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) + if (!$util.isString(message.identities[i])) + return "identities: string[] expected"; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + switch (message.identityType) { + default: + return "identityType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an EgressFrom message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} EgressFrom + */ + EgressFrom.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + message.identities[i] = String(object.identities[i]); + } + switch (object.identityType) { + default: + if (typeof object.identityType === "number") { + message.identityType = object.identityType; + break; + } + break; + case "IDENTITY_TYPE_UNSPECIFIED": + case 0: + message.identityType = 0; + break; + case "ANY_IDENTITY": + case 1: + message.identityType = 1; + break; + case "ANY_USER_ACCOUNT": + case 2: + message.identityType = 2; + break; + case "ANY_SERVICE_ACCOUNT": + case 3: + message.identityType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an EgressFrom message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom} message EgressFrom + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressFrom.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identities = []; + if (options.defaults) + object.identityType = options.enums === String ? "IDENTITY_TYPE_UNSPECIFIED" : 0; + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = message.identities[j]; + } + if (message.identityType != null && message.hasOwnProperty("identityType")) + object.identityType = options.enums === String ? $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] === undefined ? message.identityType : $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType[message.identityType] : message.identityType; + return object; + }; + + /** + * Converts this EgressFrom to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @instance + * @returns {Object.} JSON object + */ + EgressFrom.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressFrom + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressFrom.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom"; + }; + + return EgressFrom; + })(); + + ServicePerimeterConfig.EgressTo = (function() { + + /** + * Properties of an EgressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressTo + * @property {Array.|null} [resources] EgressTo resources + * @property {Array.|null} [operations] EgressTo operations + * @property {Array.|null} [externalResources] EgressTo externalResources + */ + + /** + * Constructs a new EgressTo. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressTo. + * @implements IEgressTo + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo=} [properties] Properties to set + */ + function EgressTo(properties) { + this.resources = []; + this.operations = []; + this.externalResources = []; + 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]]; + } + + /** + * EgressTo resources. + * @member {Array.} resources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.resources = $util.emptyArray; + + /** + * EgressTo operations. + * @member {Array.} operations + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.operations = $util.emptyArray; + + /** + * EgressTo externalResources. + * @member {Array.} externalResources + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + */ + EgressTo.prototype.externalResources = $util.emptyArray; + + /** + * Creates a new EgressTo instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo instance + */ + EgressTo.create = function create(properties) { + return new EgressTo(properties); + }; + + /** + * Encodes the specified EgressTo message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo} message EgressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressTo.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) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resources[i]); + if (message.operations != null && message.operations.length) + for (var i = 0; i < message.operations.length; ++i) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.encode(message.operations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.externalResources != null && message.externalResources.length) + for (var i = 0; i < message.externalResources.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalResources[i]); + return writer; + }; + + /** + * Encodes the specified EgressTo message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo} message EgressTo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressTo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressTo message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressTo.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.resources && message.resources.length)) + message.resources = []; + message.resources.push(reader.string()); + break; + } + case 2: { + if (!(message.operations && message.operations.length)) + message.operations = []; + message.operations.push($root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.externalResources && message.externalResources.length)) + message.externalResources = []; + message.externalResources.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressTo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressTo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressTo message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressTo.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) + if (!$util.isString(message.resources[i])) + return "resources: string[] expected"; + } + if (message.operations != null && message.hasOwnProperty("operations")) { + if (!Array.isArray(message.operations)) + return "operations: array expected"; + for (var i = 0; i < message.operations.length; ++i) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.verify(message.operations[i]); + if (error) + return "operations." + error; + } + } + if (message.externalResources != null && message.hasOwnProperty("externalResources")) { + if (!Array.isArray(message.externalResources)) + return "externalResources: array expected"; + for (var i = 0; i < message.externalResources.length; ++i) + if (!$util.isString(message.externalResources[i])) + return "externalResources: string[] expected"; + } + return null; + }; + + /** + * Creates an EgressTo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} EgressTo + */ + EgressTo.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo(); + if (object.resources) { + if (!Array.isArray(object.resources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.resources: array expected"); + message.resources = []; + for (var i = 0; i < object.resources.length; ++i) + message.resources[i] = String(object.resources[i]); + } + if (object.operations) { + if (!Array.isArray(object.operations)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.operations: array expected"); + message.operations = []; + for (var i = 0; i < object.operations.length; ++i) { + if (typeof object.operations[i] !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.operations: object expected"); + message.operations[i] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.fromObject(object.operations[i]); + } + } + if (object.externalResources) { + if (!Array.isArray(object.externalResources)) + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.externalResources: array expected"); + message.externalResources = []; + for (var i = 0; i < object.externalResources.length; ++i) + message.externalResources[i] = String(object.externalResources[i]); + } + return message; + }; + + /** + * Creates a plain object from an EgressTo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo} message EgressTo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressTo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.resources = []; + object.operations = []; + object.externalResources = []; + } + if (message.resources && message.resources.length) { + object.resources = []; + for (var j = 0; j < message.resources.length; ++j) + object.resources[j] = message.resources[j]; + } + if (message.operations && message.operations.length) { + object.operations = []; + for (var j = 0; j < message.operations.length; ++j) + object.operations[j] = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation.toObject(message.operations[j], options); + } + if (message.externalResources && message.externalResources.length) { + object.externalResources = []; + for (var j = 0; j < message.externalResources.length; ++j) + object.externalResources[j] = message.externalResources[j]; + } + return object; + }; + + /** + * Converts this EgressTo to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @instance + * @returns {Object.} JSON object + */ + EgressTo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressTo + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressTo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo"; + }; + + return EgressTo; + })(); + + ServicePerimeterConfig.EgressPolicy = (function() { + + /** + * Properties of an EgressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @interface IEgressPolicy + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null} [egressFrom] EgressPolicy egressFrom + * @property {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null} [egressTo] EgressPolicy egressTo + */ + + /** + * Constructs a new EgressPolicy. + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig + * @classdesc Represents an EgressPolicy. + * @implements IEgressPolicy + * @constructor + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy=} [properties] Properties to set + */ + function EgressPolicy(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]]; + } + + /** + * EgressPolicy egressFrom. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressFrom|null|undefined} egressFrom + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + */ + EgressPolicy.prototype.egressFrom = null; + + /** + * EgressPolicy egressTo. + * @member {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressTo|null|undefined} egressTo + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + */ + EgressPolicy.prototype.egressTo = null; + + /** + * Creates a new EgressPolicy instance using the specified properties. + * @function create + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy=} [properties] Properties to set + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy instance + */ + EgressPolicy.create = function create(properties) { + return new EgressPolicy(properties); + }; + + /** + * Encodes the specified EgressPolicy message. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @function encode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy} message EgressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.egressFrom != null && Object.hasOwnProperty.call(message, "egressFrom")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.encode(message.egressFrom, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.egressTo != null && Object.hasOwnProperty.call(message, "egressTo")) + $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.encode(message.egressTo, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EgressPolicy message, length delimited. Does not implicitly {@link google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IEgressPolicy} message EgressPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EgressPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressPolicy.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.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.decode(reader, reader.uint32()); + break; + } + case 2: { + message.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EgressPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EgressPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EgressPolicy message. + * @function verify + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EgressPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.egressFrom != null && message.hasOwnProperty("egressFrom")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.verify(message.egressFrom); + if (error) + return "egressFrom." + error; + } + if (message.egressTo != null && message.hasOwnProperty("egressTo")) { + var error = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.verify(message.egressTo); + if (error) + return "egressTo." + error; + } + return null; + }; + + /** + * Creates an EgressPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} EgressPolicy + */ + EgressPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy) + return object; + var message = new $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy(); + if (object.egressFrom != null) { + if (typeof object.egressFrom !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.egressFrom: object expected"); + message.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.fromObject(object.egressFrom); + } + if (object.egressTo != null) { + if (typeof object.egressTo !== "object") + throw TypeError(".google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy.egressTo: object expected"); + message.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.fromObject(object.egressTo); + } + return message; + }; + + /** + * Creates a plain object from an EgressPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy} message EgressPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EgressPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.egressFrom = null; + object.egressTo = null; + } + if (message.egressFrom != null && message.hasOwnProperty("egressFrom")) + object.egressFrom = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom.toObject(message.egressFrom, options); + if (message.egressTo != null && message.hasOwnProperty("egressTo")) + object.egressTo = $root.google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo.toObject(message.egressTo, options); + return object; + }; + + /** + * Converts this EgressPolicy to JSON. + * @function toJSON + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @instance + * @returns {Object.} JSON object + */ + EgressPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EgressPolicy + * @function getTypeUrl + * @memberof google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EgressPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy"; + }; + + return EgressPolicy; + })(); + + return ServicePerimeterConfig; + })(); + + return v1; + })(); + + accesscontextmanager.type = (function() { + + /** + * Namespace type. + * @memberof google.identity.accesscontextmanager + * @namespace + */ + var type = {}; + + /** + * DeviceEncryptionStatus enum. + * @name google.identity.accesscontextmanager.type.DeviceEncryptionStatus + * @enum {number} + * @property {number} ENCRYPTION_UNSPECIFIED=0 ENCRYPTION_UNSPECIFIED value + * @property {number} ENCRYPTION_UNSUPPORTED=1 ENCRYPTION_UNSUPPORTED value + * @property {number} UNENCRYPTED=2 UNENCRYPTED value + * @property {number} ENCRYPTED=3 ENCRYPTED value + */ + type.DeviceEncryptionStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENCRYPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENCRYPTION_UNSUPPORTED"] = 1; + values[valuesById[2] = "UNENCRYPTED"] = 2; + values[valuesById[3] = "ENCRYPTED"] = 3; + return values; + })(); + + /** + * OsType enum. + * @name google.identity.accesscontextmanager.type.OsType + * @enum {number} + * @property {number} OS_UNSPECIFIED=0 OS_UNSPECIFIED value + * @property {number} DESKTOP_MAC=1 DESKTOP_MAC value + * @property {number} DESKTOP_WINDOWS=2 DESKTOP_WINDOWS value + * @property {number} DESKTOP_LINUX=3 DESKTOP_LINUX value + * @property {number} DESKTOP_CHROME_OS=6 DESKTOP_CHROME_OS value + * @property {number} ANDROID=4 ANDROID value + * @property {number} IOS=5 IOS value + */ + type.OsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OS_UNSPECIFIED"] = 0; + values[valuesById[1] = "DESKTOP_MAC"] = 1; + values[valuesById[2] = "DESKTOP_WINDOWS"] = 2; + values[valuesById[3] = "DESKTOP_LINUX"] = 3; + values[valuesById[6] = "DESKTOP_CHROME_OS"] = 6; + values[valuesById[4] = "ANDROID"] = 4; + values[valuesById[5] = "IOS"] = 5; + return values; + })(); + + /** + * DeviceManagementLevel enum. + * @name google.identity.accesscontextmanager.type.DeviceManagementLevel + * @enum {number} + * @property {number} MANAGEMENT_UNSPECIFIED=0 MANAGEMENT_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} BASIC=2 BASIC value + * @property {number} COMPLETE=3 COMPLETE value + */ + type.DeviceManagementLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MANAGEMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "BASIC"] = 2; + values[valuesById[3] = "COMPLETE"] = 3; + return values; + })(); + + return type; + })(); + + return accesscontextmanager; + })(); + + return identity; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.json b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.json new file mode 100644 index 00000000000..832bef846ec --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/protos/protos.json @@ -0,0 +1,3322 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "asset": { + "nested": { + "v1p7beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Asset.V1P7Beta1", + "go_package": "cloud.google.com/go/asset/apiv1p7beta1/assetpb;assetpb", + "java_multiple_files": true, + "java_outer_classname": "AssetProto", + "java_package": "com.google.cloud.asset.v1p7beta1", + "php_namespace": "Google\\Cloud\\Asset\\V1p7beta1", + "cc_enable_arenas": true + }, + "nested": { + "AssetService": { + "options": { + "(google.api.default_host)": "cloudasset.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ExportAssets": { + "requestType": "ExportAssetsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p7beta1/{parent=*/*}:exportAssets", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.asset.v1p7beta1.ExportAssetsResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.asset.v1p7beta1.ExportAssetsRequest" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1p7beta1/{parent=*/*}:exportAssets", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.asset.v1p7beta1.ExportAssetsResponse", + "metadata_type": "google.cloud.asset.v1p7beta1.ExportAssetsRequest" + } + } + ] + } + } + }, + "ExportAssetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudasset.googleapis.com/Asset" + } + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "assetTypes": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "contentType": { + "type": "ContentType", + "id": 4 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "ExportAssetsResponse": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "outputConfig": { + "type": "OutputConfig", + "id": 2 + }, + "outputResult": { + "type": "OutputResult", + "id": 3 + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination", + "bigqueryDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + }, + "bigqueryDestination": { + "type": "BigQueryDestination", + "id": 2 + } + } + }, + "OutputResult": { + "oneofs": { + "result": { + "oneof": [ + "gcsResult" + ] + } + }, + "fields": { + "gcsResult": { + "type": "GcsOutputResult", + "id": 1 + } + } + }, + "GcsOutputResult": { + "fields": { + "uris": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "GcsDestination": { + "oneofs": { + "objectUri": { + "oneof": [ + "uri", + "uriPrefix" + ] + } + }, + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "uriPrefix": { + "type": "string", + "id": 2 + } + } + }, + "BigQueryDestination": { + "fields": { + "dataset": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "table": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "force": { + "type": "bool", + "id": 3 + }, + "partitionSpec": { + "type": "PartitionSpec", + "id": 4 + }, + "separateTablesPerAssetType": { + "type": "bool", + "id": 5 + } + } + }, + "PartitionSpec": { + "fields": { + "partitionKey": { + "type": "PartitionKey", + "id": 1 + } + }, + "nested": { + "PartitionKey": { + "values": { + "PARTITION_KEY_UNSPECIFIED": 0, + "READ_TIME": 1, + "REQUEST_TIME": 2 + } + } + } + }, + "ContentType": { + "values": { + "CONTENT_TYPE_UNSPECIFIED": 0, + "RESOURCE": 1, + "IAM_POLICY": 2, + "ORG_POLICY": 4, + "ACCESS_POLICY": 5, + "RELATIONSHIP": 7 + } + }, + "Asset": { + "options": { + "(google.api.resource).type": "cloudasset.googleapis.com/Asset", + "(google.api.resource).pattern": "*" + }, + "oneofs": { + "accessContextPolicy": { + "oneof": [ + "accessPolicy", + "accessLevel", + "servicePerimeter" + ] + } + }, + "fields": { + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + }, + "name": { + "type": "string", + "id": 1 + }, + "assetType": { + "type": "string", + "id": 2 + }, + "resource": { + "type": "Resource", + "id": 3 + }, + "iamPolicy": { + "type": "google.iam.v1.Policy", + "id": 4 + }, + "orgPolicy": { + "rule": "repeated", + "type": "google.cloud.orgpolicy.v1.Policy", + "id": 6 + }, + "accessPolicy": { + "type": "google.identity.accesscontextmanager.v1.AccessPolicy", + "id": 7 + }, + "accessLevel": { + "type": "google.identity.accesscontextmanager.v1.AccessLevel", + "id": 8 + }, + "servicePerimeter": { + "type": "google.identity.accesscontextmanager.v1.ServicePerimeter", + "id": 9 + }, + "relatedAssets": { + "type": "RelatedAssets", + "id": 13 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 10 + } + } + }, + "Resource": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "discoveryDocumentUri": { + "type": "string", + "id": 2 + }, + "discoveryName": { + "type": "string", + "id": 3 + }, + "resourceUrl": { + "type": "string", + "id": 4 + }, + "parent": { + "type": "string", + "id": 5 + }, + "data": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "location": { + "type": "string", + "id": 8 + } + } + }, + "RelatedAssets": { + "fields": { + "relationshipAttributes": { + "type": "RelationshipAttributes", + "id": 1 + }, + "assets": { + "rule": "repeated", + "type": "RelatedAsset", + "id": 2 + } + } + }, + "RelationshipAttributes": { + "fields": { + "type": { + "type": "string", + "id": 4 + }, + "sourceResourceType": { + "type": "string", + "id": 1 + }, + "targetResourceType": { + "type": "string", + "id": 2 + }, + "action": { + "type": "string", + "id": 3 + } + } + }, + "RelatedAsset": { + "fields": { + "asset": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Asset" + } + }, + "assetType": { + "type": "string", + "id": 2 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + } + } + } + } + }, + "orgpolicy": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.OrgPolicy.V1", + "go_package": "cloud.google.com/go/orgpolicy/apiv1/orgpolicypb;orgpolicypb", + "java_multiple_files": true, + "java_outer_classname": "OrgPolicyProto", + "java_package": "com.google.cloud.orgpolicy.v1", + "php_namespace": "Google\\Cloud\\OrgPolicy\\V1", + "ruby_package": "Google::Cloud::OrgPolicy::V1" + }, + "nested": { + "Policy": { + "oneofs": { + "policyType": { + "oneof": [ + "listPolicy", + "booleanPolicy", + "restoreDefault" + ] + } + }, + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "constraint": { + "type": "string", + "id": 2 + }, + "etag": { + "type": "bytes", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "listPolicy": { + "type": "ListPolicy", + "id": 5 + }, + "booleanPolicy": { + "type": "BooleanPolicy", + "id": 6 + }, + "restoreDefault": { + "type": "RestoreDefault", + "id": 7 + } + }, + "nested": { + "ListPolicy": { + "fields": { + "allowedValues": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "deniedValues": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "allValues": { + "type": "AllValues", + "id": 3 + }, + "suggestedValue": { + "type": "string", + "id": 4 + }, + "inheritFromParent": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "AllValues": { + "values": { + "ALL_VALUES_UNSPECIFIED": 0, + "ALLOW": 1, + "DENY": 2 + } + } + } + }, + "BooleanPolicy": { + "fields": { + "enforced": { + "type": "bool", + "id": 1 + } + } + }, + "RestoreDefault": { + "fields": {} + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "Edition": { + "values": { + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_2024": 1001, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + "EDITION_MAX": 2147483647 + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "Edition", + "id": 14 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + }, + "declaration": { + "rule": "repeated", + "type": "Declaration", + "id": 2, + "options": { + "retention": "RETENTION_SOURCE" + } + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "verification": { + "type": "VerificationState", + "id": 3, + "options": { + "default": "UNVERIFIED", + "retention": "RETENTION_SOURCE" + } + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "Declaration": { + "fields": { + "number": { + "type": "int32", + "id": 1 + }, + "fullName": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "reserved": { + "type": "bool", + "id": 5 + }, + "repeated": { + "type": "bool", + "id": 6 + } + }, + "reserved": [ + [ + 4, + 4 + ] + ] + }, + "VerificationState": { + "values": { + "DECLARATION": 0, + "UNVERIFIED": 1 + } + } + } + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "features": { + "type": "FeatureSet", + "id": 50 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 42, + 42 + ], + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 11, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 12 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "debugRedact": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "retention": { + "type": "OptionRetention", + "id": 17 + }, + "targets": { + "rule": "repeated", + "type": "OptionTargetType", + "id": 19, + "options": { + "packed": false + } + }, + "editionDefaults": { + "rule": "repeated", + "type": "EditionDefault", + "id": 20 + }, + "features": { + "type": "FeatureSet", + "id": 21 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 18, + 18 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + }, + "OptionRetention": { + "values": { + "RETENTION_UNKNOWN": 0, + "RETENTION_RUNTIME": 1, + "RETENTION_SOURCE": 2 + } + }, + "OptionTargetType": { + "values": { + "TARGET_TYPE_UNKNOWN": 0, + "TARGET_TYPE_FILE": 1, + "TARGET_TYPE_EXTENSION_RANGE": 2, + "TARGET_TYPE_MESSAGE": 3, + "TARGET_TYPE_FIELD": 4, + "TARGET_TYPE_ONEOF": 5, + "TARGET_TYPE_ENUM": 6, + "TARGET_TYPE_ENUM_ENTRY": 7, + "TARGET_TYPE_SERVICE": 8, + "TARGET_TYPE_METHOD": 9 + } + }, + "EditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "value": { + "type": "string", + "id": 2 + } + } + } + } + }, + "OneofOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 1 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "deprecatedLegacyJsonFieldConflicts": { + "type": "bool", + "id": 6, + "options": { + "deprecated": true + } + }, + "features": { + "type": "FeatureSet", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "features": { + "type": "FeatureSet", + "id": 2 + }, + "debugRedact": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "features": { + "type": "FeatureSet", + "id": 34 + }, + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "features": { + "type": "FeatureSet", + "id": 35 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "FeatureSet": { + "fields": { + "fieldPresence": { + "type": "FieldPresence", + "id": 1, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_2023", + "edition_defaults.value": "EXPLICIT" + } + }, + "enumType": { + "type": "EnumType", + "id": 2, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "OPEN" + } + }, + "repeatedFieldEncoding": { + "type": "RepeatedFieldEncoding", + "id": 3, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "PACKED" + } + }, + "utf8Validation": { + "type": "Utf8Validation", + "id": 4, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "VERIFY" + } + }, + "messageEncoding": { + "type": "MessageEncoding", + "id": 5, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO2", + "edition_defaults.value": "LENGTH_PREFIXED" + } + }, + "jsonFormat": { + "type": "JsonFormat", + "id": 6, + "options": { + "retention": "RETENTION_RUNTIME", + "targets": "TARGET_TYPE_FILE", + "edition_defaults.edition": "EDITION_PROTO3", + "edition_defaults.value": "ALLOW" + } + } + }, + "extensions": [ + [ + 1000, + 1000 + ], + [ + 1001, + 1001 + ], + [ + 1002, + 1002 + ], + [ + 9990, + 9990 + ], + [ + 9995, + 9999 + ], + [ + 10000, + 10000 + ] + ], + "reserved": [ + [ + 999, + 999 + ] + ], + "nested": { + "FieldPresence": { + "values": { + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3 + } + }, + "EnumType": { + "values": { + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2 + } + }, + "RepeatedFieldEncoding": { + "values": { + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2 + } + }, + "Utf8Validation": { + "values": { + "UTF8_VALIDATION_UNKNOWN": 0, + "VERIFY": 2, + "NONE": 3 + } + }, + "MessageEncoding": { + "values": { + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2 + } + }, + "JsonFormat": { + "values": { + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2 + } + } + } + }, + "FeatureSetDefaults": { + "fields": { + "defaults": { + "rule": "repeated", + "type": "FeatureSetEditionDefault", + "id": 1 + }, + "minimumEdition": { + "type": "Edition", + "id": 4 + }, + "maximumEdition": { + "type": "Edition", + "id": 5 + } + }, + "nested": { + "FeatureSetEditionDefault": { + "fields": { + "edition": { + "type": "Edition", + "id": 3 + }, + "features": { + "type": "FeatureSet", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Struct": { + "fields": { + "fields": { + "keyType": "string", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "kind": { + "oneof": [ + "nullValue", + "numberValue", + "stringValue", + "boolValue", + "structValue", + "listValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "NullValue", + "id": 1 + }, + "numberValue": { + "type": "double", + "id": 2 + }, + "stringValue": { + "type": "string", + "id": 3 + }, + "boolValue": { + "type": "bool", + "id": 4 + }, + "structValue": { + "type": "Struct", + "id": 5 + }, + "listValue": { + "type": "ListValue", + "id": 6 + } + } + }, + "NullValue": { + "values": { + "NULL_VALUE": 0 + } + }, + "ListValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "cloud.google.com/go/iam/apiv1/iampb;iampb", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + }, + "identity": { + "nested": { + "accesscontextmanager": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.V1", + "go_package": "cloud.google.com/go/accesscontextmanager/apiv1/accesscontextmanagerpb;accesscontextmanagerpb", + "java_multiple_files": true, + "java_outer_classname": "ServicePerimeterProto", + "java_package": "com.google.identity.accesscontextmanager.v1", + "objc_class_prefix": "GACM", + "php_namespace": "Google\\Identity\\AccessContextManager\\V1", + "ruby_package": "Google::Identity::AccessContextManager::V1" + }, + "nested": { + "AccessLevel": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/AccessLevel", + "(google.api.resource).pattern": "accessPolicies/{access_policy}/accessLevels/{access_level}" + }, + "oneofs": { + "level": { + "oneof": [ + "basic", + "custom" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "basic": { + "type": "BasicLevel", + "id": 4 + }, + "custom": { + "type": "CustomLevel", + "id": 5 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "BasicLevel": { + "fields": { + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 1 + }, + "combiningFunction": { + "type": "ConditionCombiningFunction", + "id": 2 + } + }, + "nested": { + "ConditionCombiningFunction": { + "values": { + "AND": 0, + "OR": 1 + } + } + } + }, + "Condition": { + "fields": { + "ipSubnetworks": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "devicePolicy": { + "type": "DevicePolicy", + "id": 2 + }, + "requiredAccessLevels": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "negate": { + "type": "bool", + "id": 5 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 6 + }, + "regions": { + "rule": "repeated", + "type": "string", + "id": 7 + } + } + }, + "CustomLevel": { + "fields": { + "expr": { + "type": "google.type.Expr", + "id": 1 + } + } + }, + "DevicePolicy": { + "fields": { + "requireScreenlock": { + "type": "bool", + "id": 1 + }, + "allowedEncryptionStatuses": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceEncryptionStatus", + "id": 2 + }, + "osConstraints": { + "rule": "repeated", + "type": "OsConstraint", + "id": 3 + }, + "allowedDeviceManagementLevels": { + "rule": "repeated", + "type": "google.identity.accesscontextmanager.type.DeviceManagementLevel", + "id": 6 + }, + "requireAdminApproval": { + "type": "bool", + "id": 7 + }, + "requireCorpOwned": { + "type": "bool", + "id": 8 + } + } + }, + "OsConstraint": { + "fields": { + "osType": { + "type": "google.identity.accesscontextmanager.type.OsType", + "id": 1 + }, + "minimumVersion": { + "type": "string", + "id": 2 + }, + "requireVerifiedChromeOs": { + "type": "bool", + "id": 3 + } + } + }, + "AccessPolicy": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/AccessPolicy", + "(google.api.resource).pattern": "accessPolicies/{access_policy}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "parent": { + "type": "string", + "id": 2 + }, + "title": { + "type": "string", + "id": 3 + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + }, + "ServicePerimeter": { + "options": { + "(google.api.resource).type": "accesscontextmanager.googleapis.com/ServicePerimeter", + "(google.api.resource).pattern": "accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "perimeterType": { + "type": "PerimeterType", + "id": 6 + }, + "status": { + "type": "ServicePerimeterConfig", + "id": 7 + }, + "spec": { + "type": "ServicePerimeterConfig", + "id": 8 + }, + "useExplicitDryRunSpec": { + "type": "bool", + "id": 9 + } + }, + "nested": { + "PerimeterType": { + "values": { + "PERIMETER_TYPE_REGULAR": 0, + "PERIMETER_TYPE_BRIDGE": 1 + } + } + } + }, + "ServicePerimeterConfig": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "accessLevels": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "restrictedServices": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "vpcAccessibleServices": { + "type": "VpcAccessibleServices", + "id": 10 + }, + "ingressPolicies": { + "rule": "repeated", + "type": "IngressPolicy", + "id": 8 + }, + "egressPolicies": { + "rule": "repeated", + "type": "EgressPolicy", + "id": 9 + } + }, + "nested": { + "VpcAccessibleServices": { + "fields": { + "enableRestriction": { + "type": "bool", + "id": 1 + }, + "allowedServices": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "IdentityType": { + "values": { + "IDENTITY_TYPE_UNSPECIFIED": 0, + "ANY_IDENTITY": 1, + "ANY_USER_ACCOUNT": 2, + "ANY_SERVICE_ACCOUNT": 3 + } + }, + "MethodSelector": { + "oneofs": { + "kind": { + "oneof": [ + "method", + "permission" + ] + } + }, + "fields": { + "method": { + "type": "string", + "id": 1 + }, + "permission": { + "type": "string", + "id": 2 + } + } + }, + "ApiOperation": { + "fields": { + "serviceName": { + "type": "string", + "id": 1 + }, + "methodSelectors": { + "rule": "repeated", + "type": "MethodSelector", + "id": 2 + } + } + }, + "IngressSource": { + "oneofs": { + "source": { + "oneof": [ + "accessLevel", + "resource" + ] + } + }, + "fields": { + "accessLevel": { + "type": "string", + "id": 1 + }, + "resource": { + "type": "string", + "id": 2 + } + } + }, + "IngressFrom": { + "fields": { + "sources": { + "rule": "repeated", + "type": "IngressSource", + "id": 1 + }, + "identities": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "identityType": { + "type": "IdentityType", + "id": 3 + } + } + }, + "IngressTo": { + "fields": { + "operations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 1 + }, + "resources": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "IngressPolicy": { + "fields": { + "ingressFrom": { + "type": "IngressFrom", + "id": 1 + }, + "ingressTo": { + "type": "IngressTo", + "id": 2 + } + } + }, + "EgressFrom": { + "fields": { + "identities": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "identityType": { + "type": "IdentityType", + "id": 2 + } + } + }, + "EgressTo": { + "fields": { + "resources": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "operations": { + "rule": "repeated", + "type": "ApiOperation", + "id": 2 + }, + "externalResources": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "EgressPolicy": { + "fields": { + "egressFrom": { + "type": "EgressFrom", + "id": 1 + }, + "egressTo": { + "type": "EgressTo", + "id": 2 + } + } + } + } + } + } + }, + "type": { + "options": { + "csharp_namespace": "Google.Identity.AccessContextManager.Type", + "go_package": "google.golang.org/genproto/googleapis/identity/accesscontextmanager/type", + "java_package": "com.google.identity.accesscontextmanager.type", + "java_multiple_files": true, + "java_outer_classname": "TypeProto", + "php_namespace": "Google\\Identity\\AccessContextManager\\Type", + "ruby_package": "Google::Identity::AccessContextManager::Type" + }, + "nested": { + "DeviceEncryptionStatus": { + "values": { + "ENCRYPTION_UNSPECIFIED": 0, + "ENCRYPTION_UNSUPPORTED": 1, + "UNENCRYPTED": 2, + "ENCRYPTED": 3 + } + }, + "OsType": { + "values": { + "OS_UNSPECIFIED": 0, + "DESKTOP_MAC": 1, + "DESKTOP_WINDOWS": 2, + "DESKTOP_LINUX": 3, + "DESKTOP_CHROME_OS": 6, + "ANDROID": 4, + "IOS": 5 + } + }, + "DeviceManagementLevel": { + "values": { + "MANAGEMENT_UNSPECIFIED": 0, + "NONE": 1, + "BASIC": 2, + "COMPLETE": 3 + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/samples/generated/v1p7beta1/asset_service.export_assets.js b/owl-bot-staging/google-cloud-asset/v1p7beta1/samples/generated/v1p7beta1/asset_service.export_assets.js new file mode 100644 index 00000000000..3c97d964713 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/samples/generated/v1p7beta1/asset_service.export_assets.js @@ -0,0 +1,114 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, outputConfig) { + // [START cloudasset_v1p7beta1_generated_AssetService_ExportAssets_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + */ + // const parent = 'abc123' + /** + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + */ + // const readTime = {} + /** + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * Regular expressions are also supported. For example: + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See Introduction to Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + */ + // const assetTypes = ['abc','def'] + /** + * Asset content type. If not specified, no content but the asset name will be + * returned. + */ + // const contentType = {} + /** + * Required. Output configuration indicating where the results will be output + * to. + */ + // const outputConfig = {} + /** + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. If specified, it will snapshot asset_types' + * specified relationships, or give errors if any relationship_types' + * supported types are not in asset_types. If not specified, it will + * snapshot all asset_types' supported relationships. An unspecified + * asset_types field means all supported asset_types. See Introduction to + * Cloud Asset + * Inventory (https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + */ + // const relationshipTypes = ['abc','def'] + + // Imports the Asset library + const {AssetServiceClient} = require('@google-cloud/asset').v1p7beta1; + + // Instantiates a client + const assetClient = new AssetServiceClient(); + + async function callExportAssets() { + // Construct request + const request = { + parent, + outputConfig, + }; + + // Run request + const [operation] = await assetClient.exportAssets(request); + const [response] = await operation.promise(); + console.log(response); + } + + callExportAssets(); + // [END cloudasset_v1p7beta1_generated_AssetService_ExportAssets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/samples/generated/v1p7beta1/snippet_metadata_google.cloud.asset.v1p7beta1.json b/owl-bot-staging/google-cloud-asset/v1p7beta1/samples/generated/v1p7beta1/snippet_metadata_google.cloud.asset.v1p7beta1.json new file mode 100644 index 00000000000..0f0b058801d --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/samples/generated/v1p7beta1/snippet_metadata_google.cloud.asset.v1p7beta1.json @@ -0,0 +1,75 @@ +{ + "clientLibrary": { + "name": "nodejs-asset", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.asset.v1p7beta1", + "version": "v1p7beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudasset_v1p7beta1_generated_AssetService_ExportAssets_async", + "title": "AssetService exportAssets Sample", + "origin": "API_DEFINITION", + "description": " Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in the JSON format; for BigQuery table destinations, the output table stores the fields in asset proto as columns. This API implements the [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.", + "canonical": true, + "file": "asset_service.export_assets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 106, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ExportAssets", + "fullName": "google.cloud.asset.v1p7beta1.AssetService.ExportAssets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "read_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "asset_types", + "type": "TYPE_STRING[]" + }, + { + "name": "content_type", + "type": ".google.cloud.asset.v1p7beta1.ContentType" + }, + { + "name": "output_config", + "type": ".google.cloud.asset.v1p7beta1.OutputConfig" + }, + { + "name": "relationship_types", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "AssetServiceClient", + "fullName": "google.cloud.asset.v1p7beta1.AssetServiceClient" + }, + "method": { + "shortName": "ExportAssets", + "fullName": "google.cloud.asset.v1p7beta1.AssetService.ExportAssets", + "service": { + "shortName": "AssetService", + "fullName": "google.cloud.asset.v1p7beta1.AssetService" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/src/index.ts b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/index.ts new file mode 100644 index 00000000000..a6dc3c04a1b --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2024 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 v1p7beta1 from './v1p7beta1'; +const AssetServiceClient = v1p7beta1.AssetServiceClient; +type AssetServiceClient = v1p7beta1.AssetServiceClient; +export {v1p7beta1, AssetServiceClient}; +export default {v1p7beta1, AssetServiceClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_client.ts b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_client.ts new file mode 100644 index 00000000000..c14f26ef206 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_client.ts @@ -0,0 +1,795 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions, LROperation} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1p7beta1/asset_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './asset_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Asset service definition. + * @class + * @memberof v1p7beta1 + */ +export class AssetServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + assetServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AssetServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new AssetServiceClient({fallback: true}, gax); + * ``` + */ + constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AssetServiceClient; + if (opts?.universe_domain && opts?.universeDomain && opts?.universe_domain !== opts?.universeDomain) { + throw new Error('Please set either universe_domain or universeDomain, but not both.'); + } + const universeDomainEnvVar = (typeof process === 'object' && typeof process.env === 'object') ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] : undefined; + this._universeDomain = opts?.universeDomain ?? opts?.universe_domain ?? universeDomainEnvVar ?? 'googleapis.com'; + this._servicePath = 'cloudasset.' + this._universeDomain; + const servicePath = opts?.servicePath || opts?.apiEndpoint || this._servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== this._servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = this._servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === this._servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && '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}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + accessLevelPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/accessLevels/{access_level}' + ), + accessPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}' + ), + servicePerimeterPathTemplate: new this._gaxModule.PathTemplate( + 'accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // 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 lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.GetOperation',get: '/v1p7beta1/{name=*/*/operations/*/**}',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const exportAssetsResponse = protoFilesRoot.lookup( + '.google.cloud.asset.v1p7beta1.ExportAssetsResponse') as gax.protobuf.Type; + const exportAssetsMetadata = protoFilesRoot.lookup( + '.google.cloud.asset.v1p7beta1.ExportAssetsRequest') as gax.protobuf.Type; + + this.descriptors.longrunning = { + exportAssets: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + exportAssetsResponse.decode.bind(exportAssetsResponse), + exportAssetsMetadata.decode.bind(exportAssetsMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.asset.v1p7beta1.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 = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * 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.v1p7beta1.AssetService. + this.assetServiceStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.asset.v1p7beta1.AssetService') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.asset.v1p7beta1.AssetService, + this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const assetServiceStubMethods = + ['exportAssets']; + for (const methodName of assetServiceStubMethods) { + const callPromise = this.assetServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.assetServiceStub; + } + + /** + * The DNS address for this API service. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static servicePath is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath. + * @deprecated Use the apiEndpoint method of the client instance. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + process.emitWarning('Static apiEndpoint is deprecated, please use the instance method instead.', 'DeprecationWarning'); + } + return 'cloudasset.googleapis.com'; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + get apiEndpoint() { + return this._servicePath; + } + + get universeDomain() { + return this._universeDomain; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + +/** + * Exports assets with time and resource types to a given Cloud Storage + * location/BigQuery table. For Cloud Storage location destinations, the + * output format is newline-delimited JSON. Each line represents a + * {@link protos.google.cloud.asset.v1p7beta1.Asset|google.cloud.asset.v1p7beta1.Asset} in + * the JSON format; for BigQuery table destinations, the output table stores + * the fields in asset proto as columns. This API implements the + * {@link protos.google.longrunning.Operation|google.longrunning.Operation} API , which + * allows you to keep track of the export. We recommend intervals of at least + * 2 seconds with exponential retry to poll the export operation result. For + * regular-size resource parent, the export operation usually finishes within + * 5 minutes. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The relative name of the root asset. This can only be an + * organization number (such as "organizations/123"), a project ID (such as + * "projects/my-project-id"), or a project number (such as "projects/12345"), + * or a folder number (such as "folders/123"). + * @param {google.protobuf.Timestamp} request.readTime + * Timestamp to take an asset snapshot. This can only be set to a timestamp + * between the current time and the current time minus 35 days (inclusive). + * If not specified, the current time will be used. Due to delays in resource + * data collection and indexing, there is a volatile window during which + * running the same query may get different results. + * @param {string[]} request.assetTypes + * A list of asset types to take a snapshot for. For example: + * "compute.googleapis.com/Disk". + * + * Regular expressions are also supported. For example: + * + * * "compute.googleapis.com.*" snapshots resources whose asset type starts + * with "compute.googleapis.com". + * * ".*Instance" snapshots resources whose asset type ends with "Instance". + * * ".*Instance.*" snapshots resources whose asset type contains "Instance". + * + * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + * regular expression syntax. If the regular expression does not match any + * supported asset type, an INVALID_ARGUMENT error will be returned. + * + * If specified, only matching assets will be returned, otherwise, it will + * snapshot all asset types. See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types. + * @param {google.cloud.asset.v1p7beta1.ContentType} request.contentType + * Asset content type. If not specified, no content but the asset name will be + * returned. + * @param {google.cloud.asset.v1p7beta1.OutputConfig} request.outputConfig + * Required. Output configuration indicating where the results will be output + * to. + * @param {string[]} request.relationshipTypes + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]' + * specified relationships, or give errors if any relationship_types' + * supported types are not in [asset_types]. If not specified, it will + * snapshot all [asset_types]' supported relationships. An unspecified + * [asset_types] field means all supported asset_types. See [Introduction to + * Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1p7beta1/asset_service.export_assets.js + * region_tag:cloudasset_v1p7beta1_generated_AssetService_ExportAssets_async + */ + exportAssets( + request?: protos.google.cloud.asset.v1p7beta1.IExportAssetsRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + exportAssets( + request: protos.google.cloud.asset.v1p7beta1.IExportAssetsRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportAssets( + request: protos.google.cloud.asset.v1p7beta1.IExportAssetsRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + exportAssets( + request?: protos.google.cloud.asset.v1p7beta1.IExportAssetsRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = this._gaxModule.routingHeader.fromParams({ + 'parent': request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.exportAssets(request, options, callback); + } +/** + * Check the status of the long running operation returned by `exportAssets()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1p7beta1/asset_service.export_assets.js + * region_tag:cloudasset_v1p7beta1_generated_AssetService_ExportAssets_async + */ + async checkExportAssetsProgress(name: string): Promise>{ + const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation(operation, this.descriptors.longrunning.exportAssets, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified accessLevel resource name string. + * + * @param {string} access_policy + * @param {string} access_level + * @returns {string} Resource name string. + */ + accessLevelPath(accessPolicy:string,accessLevel:string) { + return this.pathTemplates.accessLevelPathTemplate.render({ + access_policy: accessPolicy, + access_level: accessLevel, + }); + } + + /** + * Parse the access_policy from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName).access_policy; + } + + /** + * Parse the access_level from AccessLevel resource. + * + * @param {string} accessLevelName + * A fully-qualified path representing AccessLevel resource. + * @returns {string} A string representing the access_level. + */ + matchAccessLevelFromAccessLevelName(accessLevelName: string) { + return this.pathTemplates.accessLevelPathTemplate.match(accessLevelName).access_level; + } + + /** + * Return a fully-qualified accessPolicy resource name string. + * + * @param {string} access_policy + * @returns {string} Resource name string. + */ + accessPolicyPath(accessPolicy:string) { + return this.pathTemplates.accessPolicyPathTemplate.render({ + access_policy: accessPolicy, + }); + } + + /** + * Parse the access_policy from AccessPolicy resource. + * + * @param {string} accessPolicyName + * A fully-qualified path representing AccessPolicy resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromAccessPolicyName(accessPolicyName: string) { + return this.pathTemplates.accessPolicyPathTemplate.match(accessPolicyName).access_policy; + } + + /** + * Return a fully-qualified servicePerimeter resource name string. + * + * @param {string} access_policy + * @param {string} service_perimeter + * @returns {string} Resource name string. + */ + servicePerimeterPath(accessPolicy:string,servicePerimeter:string) { + return this.pathTemplates.servicePerimeterPathTemplate.render({ + access_policy: accessPolicy, + service_perimeter: servicePerimeter, + }); + } + + /** + * Parse the access_policy from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the access_policy. + */ + matchAccessPolicyFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match(servicePerimeterName).access_policy; + } + + /** + * Parse the service_perimeter from ServicePerimeter resource. + * + * @param {string} servicePerimeterName + * A fully-qualified path representing ServicePerimeter resource. + * @returns {string} A string representing the service_perimeter. + */ + matchServicePerimeterFromServicePerimeterName(servicePerimeterName: string) { + return this.pathTemplates.servicePerimeterPathTemplate.match(servicePerimeterName).service_perimeter; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.assetServiceStub && !this._terminated) { + return this.assetServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_client_config.json b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_client_config.json new file mode 100644 index 00000000000..15f0c80cfa6 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_client_config.json @@ -0,0 +1,31 @@ +{ + "interfaces": { + "google.cloud.asset.v1p7beta1.AssetService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ExportAssets": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_proto_list.json b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_proto_list.json new file mode 100644 index 00000000000..5717cd844fe --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/asset_service_proto_list.json @@ -0,0 +1,9 @@ +[ + "../../protos/google/cloud/asset/v1p7beta1/asset_service.proto", + "../../protos/google/cloud/asset/v1p7beta1/assets.proto", + "../../protos/google/cloud/orgpolicy/v1/orgpolicy.proto", + "../../protos/google/identity/accesscontextmanager/type/device_resources.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_level.proto", + "../../protos/google/identity/accesscontextmanager/v1/access_policy.proto", + "../../protos/google/identity/accesscontextmanager/v1/service_perimeter.proto" +] diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/gapic_metadata.json new file mode 100644 index 00000000000..8e0f934ddfe --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.asset.v1p7beta1", + "libraryPackage": "@google-cloud/asset", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "ExportAssets": { + "methods": [ + "exportAssets" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "ExportAssets": { + "methods": [ + "exportAssets" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/index.ts b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/index.ts new file mode 100644 index 00000000000..f87a8e44978 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/src/v1p7beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2024 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/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..997ccf2219e --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const asset = require('@google-cloud/asset'); + +function main() { + const assetServiceClient = new asset.AssetServiceClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..1794fc57ef2 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {AssetServiceClient} from '@google-cloud/asset'; + +// check that the client class type name can be used +function doStuffWithAssetServiceClient(client: AssetServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const assetServiceClient = new AssetServiceClient(); + doStuffWithAssetServiceClient(assetServiceClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/install.ts b/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/install.ts new file mode 100644 index 00000000000..fd5bfdc71d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/test/gapic_asset_service_v1p7beta1.ts b/owl-bot-staging/google-cloud-asset/v1p7beta1/test/gapic_asset_service_v1p7beta1.ts new file mode 100644 index 00000000000..c22925860ae --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/test/gapic_asset_service_v1p7beta1.ts @@ -0,0 +1,764 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as assetserviceModule from '../src'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1p7beta1.AssetServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient(); + const universeDomain = client.universeDomain; + assert.strictEqual(universeDomain, "googleapis.com"); + }); + + if (typeof process === 'object' && typeof process.emitWarning === 'function') { + it('throws DeprecationWarning if static servicePath is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const servicePath = assetserviceModule.v1p7beta1.AssetServiceClient.servicePath; + assert.strictEqual(servicePath, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = assetserviceModule.v1p7beta1.AssetServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudasset.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + }); + + if (typeof process === 'object' && 'env' in process) { + describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { + it('sets apiEndpoint from environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1p7beta1.AssetServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + + it('value configured in code has priority over environment variable', () => { + const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudasset.configured.example.com'); + if (saved) { + process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; + } else { + delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; + } + }); + }); + } + it('does not allow setting both universeDomain and universe_domain', () => { + assert.throws(() => { new assetserviceModule.v1p7beta1.AssetServiceClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = assetserviceModule.v1p7beta1.AssetServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new assetserviceModule.v1p7beta1.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 for the initialized client', done => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.assetServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.assetServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('exportAssets', () => { + it('invokes exportAssets without error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p7beta1.ExportAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p7beta1.ExportAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCall(expectedResponse); + const [operation] = await client.exportAssets(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAssets without error using callback', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p7beta1.ExportAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p7beta1.ExportAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.exportAssets = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.exportAssets( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAssets with call error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p7beta1.ExportAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p7beta1.ExportAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.exportAssets(request), expectedError); + const actualRequest = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes exportAssets with LRO error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.asset.v1p7beta1.ExportAssetsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.asset.v1p7beta1.ExportAssetsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.exportAssets = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.exportAssets(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.exportAssets as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkExportAssetsProgress without error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')} + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkExportAssetsProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkExportAssetsProgress with error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.checkExportAssetsProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.getOperation(request)}, expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.cancelOperation(request)}, expectedError); + assert((client.operationsClient.cancelOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall(undefined, expectedError); + await assert.rejects(async () => {await client.deleteOperation(request)}, expectedError); + assert((client.operationsClient.deleteOperation as SinonStub) + .getCall(0).calledWith(request)); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); + }); + + describe('Path templates', () => { + + describe('accessLevel', () => { + const fakePath = "/rendered/path/accessLevel"; + const expectedParameters = { + access_policy: "accessPolicyValue", + access_level: "accessLevelValue", + }; + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessLevelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accessLevelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accessLevelPath', () => { + const result = client.accessLevelPath("accessPolicyValue", "accessLevelValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accessLevelPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromAccessLevelName', () => { + const result = client.matchAccessPolicyFromAccessLevelName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchAccessLevelFromAccessLevelName', () => { + const result = client.matchAccessLevelFromAccessLevelName(fakePath); + assert.strictEqual(result, "accessLevelValue"); + assert((client.pathTemplates.accessLevelPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('accessPolicy', () => { + const fakePath = "/rendered/path/accessPolicy"; + const expectedParameters = { + access_policy: "accessPolicyValue", + }; + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.accessPolicyPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.accessPolicyPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('accessPolicyPath', () => { + const result = client.accessPolicyPath("accessPolicyValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.accessPolicyPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromAccessPolicyName', () => { + const result = client.matchAccessPolicyFromAccessPolicyName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.accessPolicyPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('servicePerimeter', () => { + const fakePath = "/rendered/path/servicePerimeter"; + const expectedParameters = { + access_policy: "accessPolicyValue", + service_perimeter: "servicePerimeterValue", + }; + const client = new assetserviceModule.v1p7beta1.AssetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.servicePerimeterPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.servicePerimeterPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('servicePerimeterPath', () => { + const result = client.servicePerimeterPath("accessPolicyValue", "servicePerimeterValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.servicePerimeterPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchAccessPolicyFromServicePerimeterName', () => { + const result = client.matchAccessPolicyFromServicePerimeterName(fakePath); + assert.strictEqual(result, "accessPolicyValue"); + assert((client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchServicePerimeterFromServicePerimeterName', () => { + const result = client.matchServicePerimeterFromServicePerimeterName(fakePath); + assert.strictEqual(result, "servicePerimeterValue"); + assert((client.pathTemplates.servicePerimeterPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/tsconfig.json b/owl-bot-staging/google-cloud-asset/v1p7beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/google-cloud-asset/v1p7beta1/webpack.config.js b/owl-bot-staging/google-cloud-asset/v1p7beta1/webpack.config.js new file mode 100644 index 00000000000..9d42a74b844 --- /dev/null +++ b/owl-bot-staging/google-cloud-asset/v1p7beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'AssetService', + filename: './asset-service.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +};